home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 5 / BBS in a Box -Volume V (BBS in a Box) (April 1992).iso / Files / Prog / M / MPWGCC (Machines).cpt / Miscellaneous / gcc.c < prev    next >
MacBinary  |  1990-03-08  |  52.0 KB  |  [TEXT/MPS ]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
10% dexvert Jesper Olsen Module (music/jesperOlsen) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Thu Mar 8 14:02:38 1990, modified Thu Mar 8 14:02:38 1990, creator 'MPS ', type ASCII, 52510 bytes "gcc.c" , at 0xcd9e 428 bytes resource default (weak)
99% file data default
49% TrID Macintosh plain text (MacBinary) default
33% TrID TTComp archive compressed (bin-2K) default (weak)
16% TrID MacBinary 2 default (weak)
0% TrID Sybase iAnywhere database files default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPS ]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 05 67 63 63 2e 63 00 | 00 00 00 00 00 00 00 00 |..gcc.c.|........|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 00 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 cd 1e 00 | 00 01 ac a2 1c 5c ce a2 |........|.....\..|
|00000060| 1c 5c ce 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.\......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 21 e8 00 00 |........|....!...|
|00000080| 2f 2a 20 43 6f 6d 70 69 | 6c 65 72 20 64 72 69 76 |/* Compi|ler driv|
|00000090| 65 72 20 70 72 6f 67 72 | 61 6d 20 74 68 61 74 20 |er progr|am that |
|000000a0| 63 61 6e 20 68 61 6e 64 | 6c 65 20 6d 61 6e 79 20 |can hand|le many |
|000000b0| 6c 61 6e 67 75 61 67 65 | 73 2e 0d 20 20 20 43 6f |language|s.. Co|
|000000c0| 70 79 72 69 67 68 74 20 | 28 43 29 20 31 39 38 37 |pyright |(C) 1987|
|000000d0| 2c 31 39 38 39 20 46 72 | 65 65 20 53 6f 66 74 77 |,1989 Fr|ee Softw|
|000000e0| 61 72 65 20 46 6f 75 6e | 64 61 74 69 6f 6e 2c 20 |are Foun|dation, |
|000000f0| 49 6e 63 2e 0d 0d 54 68 | 69 73 20 66 69 6c 65 20 |Inc...Th|is file |
|00000100| 69 73 20 70 61 72 74 20 | 6f 66 20 47 4e 55 20 43 |is part |of GNU C|
|00000110| 43 2e 0d 0d 47 4e 55 20 | 43 43 20 69 73 20 66 72 |C...GNU |CC is fr|
|00000120| 65 65 20 73 6f 66 74 77 | 61 72 65 3b 20 79 6f 75 |ee softw|are; you|
|00000130| 20 63 61 6e 20 72 65 64 | 69 73 74 72 69 62 75 74 | can red|istribut|
|00000140| 65 20 69 74 20 61 6e 64 | 2f 6f 72 20 6d 6f 64 69 |e it and|/or modi|
|00000150| 66 79 0d 69 74 20 75 6e | 64 65 72 20 74 68 65 20 |fy.it un|der the |
|00000160| 74 65 72 6d 73 20 6f 66 | 20 74 68 65 20 47 4e 55 |terms of| the GNU|
|00000170| 20 47 65 6e 65 72 61 6c | 20 50 75 62 6c 69 63 20 | General| Public |
|00000180| 4c 69 63 65 6e 73 65 20 | 61 73 20 70 75 62 6c 69 |License |as publi|
|00000190| 73 68 65 64 20 62 79 0d | 74 68 65 20 46 72 65 65 |shed by.|the Free|
|000001a0| 20 53 6f 66 74 77 61 72 | 65 20 46 6f 75 6e 64 61 | Softwar|e Founda|
|000001b0| 74 69 6f 6e 3b 20 65 69 | 74 68 65 72 20 76 65 72 |tion; ei|ther ver|
|000001c0| 73 69 6f 6e 20 31 2c 20 | 6f 72 20 28 61 74 20 79 |sion 1, |or (at y|
|000001d0| 6f 75 72 20 6f 70 74 69 | 6f 6e 29 0d 61 6e 79 20 |our opti|on).any |
|000001e0| 6c 61 74 65 72 20 76 65 | 72 73 69 6f 6e 2e 0d 0d |later ve|rsion...|
|000001f0| 47 4e 55 20 43 43 20 69 | 73 20 64 69 73 74 72 69 |GNU CC i|s distri|
|00000200| 62 75 74 65 64 20 69 6e | 20 74 68 65 20 68 6f 70 |buted in| the hop|
|00000210| 65 20 74 68 61 74 20 69 | 74 20 77 69 6c 6c 20 62 |e that i|t will b|
|00000220| 65 20 75 73 65 66 75 6c | 2c 0d 62 75 74 20 57 49 |e useful|,.but WI|
|00000230| 54 48 4f 55 54 20 41 4e | 59 20 57 41 52 52 41 4e |THOUT AN|Y WARRAN|
|00000240| 54 59 3b 20 77 69 74 68 | 6f 75 74 20 65 76 65 6e |TY; with|out even|
|00000250| 20 74 68 65 20 69 6d 70 | 6c 69 65 64 20 77 61 72 | the imp|lied war|
|00000260| 72 61 6e 74 79 20 6f 66 | 0d 4d 45 52 43 48 41 4e |ranty of|.MERCHAN|
|00000270| 54 41 42 49 4c 49 54 59 | 20 6f 72 20 46 49 54 4e |TABILITY| or FITN|
|00000280| 45 53 53 20 46 4f 52 20 | 41 20 50 41 52 54 49 43 |ESS FOR |A PARTIC|
|00000290| 55 4c 41 52 20 50 55 52 | 50 4f 53 45 2e 20 20 53 |ULAR PUR|POSE. S|
|000002a0| 65 65 20 74 68 65 0d 47 | 4e 55 20 47 65 6e 65 72 |ee the.G|NU Gener|
|000002b0| 61 6c 20 50 75 62 6c 69 | 63 20 4c 69 63 65 6e 73 |al Publi|c Licens|
|000002c0| 65 20 66 6f 72 20 6d 6f | 72 65 20 64 65 74 61 69 |e for mo|re detai|
|000002d0| 6c 73 2e 0d 0d 59 6f 75 | 20 73 68 6f 75 6c 64 20 |ls...You| should |
|000002e0| 68 61 76 65 20 72 65 63 | 65 69 76 65 64 20 61 20 |have rec|eived a |
|000002f0| 63 6f 70 79 20 6f 66 20 | 74 68 65 20 47 4e 55 20 |copy of |the GNU |
|00000300| 47 65 6e 65 72 61 6c 20 | 50 75 62 6c 69 63 20 4c |General |Public L|
|00000310| 69 63 65 6e 73 65 0d 61 | 6c 6f 6e 67 20 77 69 74 |icense.a|long wit|
|00000320| 68 20 47 4e 55 20 43 43 | 3b 20 73 65 65 20 74 68 |h GNU CC|; see th|
|00000330| 65 20 66 69 6c 65 20 43 | 4f 50 59 49 4e 47 2e 20 |e file C|OPYING. |
|00000340| 20 49 66 20 6e 6f 74 2c | 20 77 72 69 74 65 20 74 | If not,| write t|
|00000350| 6f 0d 74 68 65 20 46 72 | 65 65 20 53 6f 66 74 77 |o.the Fr|ee Softw|
|00000360| 61 72 65 20 46 6f 75 6e | 64 61 74 69 6f 6e 2c 20 |are Foun|dation, |
|00000370| 36 37 35 20 4d 61 73 73 | 20 41 76 65 2c 20 43 61 |675 Mass| Ave, Ca|
|00000380| 6d 62 72 69 64 67 65 2c | 20 4d 41 20 30 32 31 33 |mbridge,| MA 0213|
|00000390| 39 2c 20 55 53 41 2e 0d | 0d 54 68 69 73 20 70 61 |9, USA..|.This pa|
|000003a0| 72 61 67 72 61 70 68 20 | 69 73 20 68 65 72 65 20 |ragraph |is here |
|000003b0| 74 6f 20 74 72 79 20 74 | 6f 20 6b 65 65 70 20 53 |to try t|o keep S|
|000003c0| 75 6e 20 43 43 20 66 72 | 6f 6d 20 64 79 69 6e 67 |un CC fr|om dying|
|000003d0| 2e 0d 54 68 65 20 6e 75 | 6d 62 65 72 20 6f 66 20 |..The nu|mber of |
|000003e0| 63 68 61 72 73 20 68 65 | 72 65 20 73 65 65 6d 73 |chars he|re seems|
|000003f0| 20 63 72 75 63 69 61 6c | 21 21 21 21 20 20 2a 2f | crucial|!!!! */|
|00000400| 0d 0d 76 6f 69 64 20 72 | 65 63 6f 72 64 5f 74 65 |..void r|ecord_te|
|00000410| 6d 70 5f 66 69 6c 65 20 | 28 29 3b 0d 0c 0d 2f 2a |mp_file |();.../*|
|00000420| 20 54 68 69 73 20 70 72 | 6f 67 72 61 6d 20 69 73 | This pr|ogram is|
|00000430| 20 74 68 65 20 75 73 65 | 72 20 69 6e 74 65 72 66 | the use|r interf|
|00000440| 61 63 65 20 74 6f 20 74 | 68 65 20 43 20 63 6f 6d |ace to t|he C com|
|00000450| 70 69 6c 65 72 20 61 6e | 64 20 70 6f 73 73 69 62 |piler an|d possib|
|00000460| 6c 79 20 74 6f 0d 6f 74 | 68 65 72 20 63 6f 6d 70 |ly to.ot|her comp|
|00000470| 69 6c 65 72 73 2e 20 20 | 49 74 20 69 73 20 75 73 |ilers. |It is us|
|00000480| 65 64 20 62 65 63 61 75 | 73 65 20 63 6f 6d 70 69 |ed becau|se compi|
|00000490| 6c 61 74 69 6f 6e 20 69 | 73 20 61 20 63 6f 6d 70 |lation i|s a comp|
|000004a0| 6c 69 63 61 74 65 64 20 | 70 72 6f 63 65 64 75 72 |licated |procedur|
|000004b0| 65 0d 77 68 69 63 68 20 | 69 6e 76 6f 6c 76 65 73 |e.which |involves|
|000004c0| 20 72 75 6e 6e 69 6e 67 | 20 73 65 76 65 72 61 6c | running| several|
|000004d0| 20 70 72 6f 67 72 61 6d | 73 20 61 6e 64 20 70 61 | program|s and pa|
|000004e0| 73 73 69 6e 67 20 74 65 | 6d 70 6f 72 61 72 79 20 |ssing te|mporary |
|000004f0| 66 69 6c 65 73 20 62 65 | 74 77 65 65 6e 0d 74 68 |files be|tween.th|
|00000500| 65 6d 2c 20 66 6f 72 77 | 61 72 64 69 6e 67 20 74 |em, forw|arding t|
|00000510| 68 65 20 75 73 65 72 73 | 20 73 77 69 74 63 68 65 |he users| switche|
|00000520| 73 20 74 6f 20 74 68 6f | 73 65 20 70 72 6f 67 72 |s to tho|se progr|
|00000530| 61 6d 73 20 73 65 6c 65 | 63 74 69 76 65 6c 79 2c |ams sele|ctively,|
|00000540| 0d 61 6e 64 20 64 65 6c | 65 74 69 6e 67 20 74 68 |.and del|eting th|
|00000550| 65 20 74 65 6d 70 6f 72 | 61 72 79 20 66 69 6c 65 |e tempor|ary file|
|00000560| 73 20 61 74 20 74 68 65 | 20 65 6e 64 2e 0d 0d 43 |s at the| end...C|
|00000570| 43 20 72 65 63 6f 67 6e | 69 7a 65 73 20 68 6f 77 |C recogn|izes how|
|00000580| 20 74 6f 20 63 6f 6d 70 | 69 6c 65 20 65 61 63 68 | to comp|ile each|
|00000590| 20 69 6e 70 75 74 20 66 | 69 6c 65 20 62 79 20 73 | input f|ile by s|
|000005a0| 75 66 66 69 78 65 73 20 | 69 6e 20 74 68 65 20 66 |uffixes |in the f|
|000005b0| 69 6c 65 20 6e 61 6d 65 | 73 2e 0d 4f 6e 63 65 20 |ile name|s..Once |
|000005c0| 69 74 20 6b 6e 6f 77 73 | 20 77 68 69 63 68 20 6b |it knows| which k|
|000005d0| 69 6e 64 20 6f 66 20 63 | 6f 6d 70 69 6c 61 74 69 |ind of c|ompilati|
|000005e0| 6f 6e 20 74 6f 20 70 65 | 72 66 6f 72 6d 2c 20 74 |on to pe|rform, t|
|000005f0| 68 65 20 70 72 6f 63 65 | 64 75 72 65 20 66 6f 72 |he proce|dure for|
|00000600| 0d 63 6f 6d 70 69 6c 61 | 74 69 6f 6e 20 69 73 20 |.compila|tion is |
|00000610| 73 70 65 63 69 66 69 65 | 64 20 62 79 20 61 20 73 |specifie|d by a s|
|00000620| 74 72 69 6e 67 20 63 61 | 6c 6c 65 64 20 61 20 22 |tring ca|lled a "|
|00000630| 73 70 65 63 22 2e 0d 0d | 53 70 65 63 73 20 61 72 |spec"...|Specs ar|
|00000640| 65 20 73 74 72 69 6e 67 | 73 20 63 6f 6e 74 61 69 |e string|s contai|
|00000650| 6e 69 6e 67 20 6c 69 6e | 65 73 2c 20 65 61 63 68 |ning lin|es, each|
|00000660| 20 6f 66 20 77 68 69 63 | 68 20 28 69 66 20 6e 6f | of whic|h (if no|
|00000670| 74 20 62 6c 61 6e 6b 29 | 0d 69 73 20 6d 61 64 65 |t blank)|.is made|
|00000680| 20 75 70 20 6f 66 20 61 | 20 70 72 6f 67 72 61 6d | up of a| program|
|00000690| 20 6e 61 6d 65 2c 20 61 | 6e 64 20 61 72 67 75 6d | name, a|nd argum|
|000006a0| 65 6e 74 73 20 73 65 70 | 61 72 61 74 65 64 20 62 |ents sep|arated b|
|000006b0| 79 20 73 70 61 63 65 73 | 2e 0d 54 68 65 20 70 72 |y spaces|..The pr|
|000006c0| 6f 67 72 61 6d 20 6e 61 | 6d 65 20 6d 75 73 74 20 |ogram na|me must |
|000006d0| 62 65 20 65 78 61 63 74 | 20 61 6e 64 20 73 74 61 |be exact| and sta|
|000006e0| 72 74 20 66 72 6f 6d 20 | 72 6f 6f 74 2c 20 73 69 |rt from |root, si|
|000006f0| 6e 63 65 20 6e 6f 20 70 | 61 74 68 0d 69 73 20 73 |nce no p|ath.is s|
|00000700| 65 61 72 63 68 65 64 20 | 61 6e 64 20 69 74 20 69 |earched |and it i|
|00000710| 73 20 75 6e 72 65 6c 69 | 61 62 6c 65 20 74 6f 20 |s unreli|able to |
|00000720| 64 65 70 65 6e 64 20 6f | 6e 20 74 68 65 20 63 75 |depend o|n the cu|
|00000730| 72 72 65 6e 74 20 77 6f | 72 6b 69 6e 67 20 64 69 |rrent wo|rking di|
|00000740| 72 65 63 74 6f 72 79 2e | 0d 52 65 64 69 72 65 63 |rectory.|.Redirec|
|00000750| 74 69 6f 6e 20 6f 66 20 | 69 6e 70 75 74 20 6f 72 |tion of |input or|
|00000760| 20 6f 75 74 70 75 74 20 | 69 73 20 6e 6f 74 20 73 | output |is not s|
|00000770| 75 70 70 6f 72 74 65 64 | 3b 20 74 68 65 20 73 75 |upported|; the su|
|00000780| 62 70 72 6f 67 72 61 6d | 73 20 6d 75 73 74 0d 61 |bprogram|s must.a|
|00000790| 63 63 65 70 74 20 66 69 | 6c 65 6e 61 6d 65 73 20 |ccept fi|lenames |
|000007a0| 73 61 79 69 6e 67 20 77 | 68 61 74 20 66 69 6c 65 |saying w|hat file|
|000007b0| 73 20 74 6f 20 72 65 61 | 64 20 61 6e 64 20 77 72 |s to rea|d and wr|
|000007c0| 69 74 65 2e 0d 0d 49 6e | 20 61 64 64 69 74 69 6f |ite...In| additio|
|000007d0| 6e 2c 20 74 68 65 20 73 | 70 65 63 73 20 63 61 6e |n, the s|pecs can|
|000007e0| 20 63 6f 6e 74 61 69 6e | 20 25 2d 73 65 71 75 65 | contain| %-seque|
|000007f0| 6e 63 65 73 20 74 6f 20 | 73 75 62 73 74 69 74 75 |nces to |substitu|
|00000800| 74 65 20 76 61 72 69 61 | 62 6c 65 20 74 65 78 74 |te varia|ble text|
|00000810| 0d 6f 72 20 66 6f 72 20 | 63 6f 6e 64 69 74 69 6f |.or for |conditio|
|00000820| 6e 61 6c 20 74 65 78 74 | 2e 20 20 48 65 72 65 20 |nal text|. Here |
|00000830| 69 73 20 61 20 74 61 62 | 6c 65 20 6f 66 20 61 6c |is a tab|le of al|
|00000840| 6c 20 64 65 66 69 6e 65 | 64 20 25 2d 73 65 71 75 |l define|d %-sequ|
|00000850| 65 6e 63 65 73 2e 0d 4e | 6f 74 65 20 74 68 61 74 |ences..N|ote that|
|00000860| 20 73 70 61 63 65 73 20 | 61 72 65 20 6e 6f 74 20 | spaces |are not |
|00000870| 67 65 6e 65 72 61 74 65 | 64 20 61 75 74 6f 6d 61 |generate|d automa|
|00000880| 74 69 63 61 6c 6c 79 20 | 61 72 6f 75 6e 64 20 74 |tically |around t|
|00000890| 68 65 20 72 65 73 75 6c | 74 73 20 6f 66 0d 65 78 |he resul|ts of.ex|
|000008a0| 70 61 6e 64 69 6e 67 20 | 74 68 65 73 65 20 73 65 |panding |these se|
|000008b0| 71 75 65 6e 63 65 73 3b | 20 74 68 65 72 65 66 6f |quences;| therefo|
|000008c0| 72 65 2c 20 79 6f 75 20 | 63 61 6e 20 63 6f 6e 63 |re, you |can conc|
|000008d0| 61 74 65 6e 61 74 65 20 | 74 68 65 6d 20 74 6f 67 |atenate |them tog|
|000008e0| 65 74 68 65 72 0d 6f 72 | 20 77 69 74 68 20 63 6f |ether.or| with co|
|000008f0| 6e 73 74 61 6e 74 20 74 | 65 78 74 20 69 6e 20 61 |nstant t|ext in a|
|00000900| 20 73 69 6e 67 6c 65 20 | 61 72 67 75 6d 65 6e 74 | single |argument|
|00000910| 2e 0d 0d 20 25 25 09 73 | 75 62 73 74 69 74 75 74 |... %%.s|ubstitut|
|00000920| 65 20 6f 6e 65 20 25 20 | 69 6e 74 6f 20 74 68 65 |e one % |into the|
|00000930| 20 70 72 6f 67 72 61 6d | 20 6e 61 6d 65 20 6f 72 | program| name or|
|00000940| 20 61 72 67 75 6d 65 6e | 74 2e 0d 20 25 69 20 20 | argumen|t.. %i |
|00000950| 20 20 20 73 75 62 73 74 | 69 74 75 74 65 20 74 68 | subst|itute th|
|00000960| 65 20 6e 61 6d 65 20 6f | 66 20 74 68 65 20 69 6e |e name o|f the in|
|00000970| 70 75 74 20 66 69 6c 65 | 20 62 65 69 6e 67 20 70 |put file| being p|
|00000980| 72 6f 63 65 73 73 65 64 | 2e 0d 20 25 62 20 20 20 |rocessed|.. %b |
|00000990| 20 20 73 75 62 73 74 69 | 74 75 74 65 20 74 68 65 | substi|tute the|
|000009a0| 20 62 61 73 65 6e 61 6d | 65 20 6f 66 20 74 68 65 | basenam|e of the|
|000009b0| 20 69 6e 70 75 74 20 66 | 69 6c 65 20 62 65 69 6e | input f|ile bein|
|000009c0| 67 20 70 72 6f 63 65 73 | 73 65 64 2e 0d 09 54 68 |g proces|sed...Th|
|000009d0| 69 73 20 69 73 20 74 68 | 65 20 73 75 62 73 74 72 |is is th|e substr|
|000009e0| 69 6e 67 20 75 70 20 74 | 6f 20 28 61 6e 64 20 6e |ing up t|o (and n|
|000009f0| 6f 74 20 69 6e 63 6c 75 | 64 69 6e 67 29 20 74 68 |ot inclu|ding) th|
|00000a00| 65 20 6c 61 73 74 20 70 | 65 72 69 6f 64 2e 0d 20 |e last p|eriod.. |
|00000a10| 25 67 20 20 20 20 20 73 | 75 62 73 74 69 74 75 74 |%g s|ubstitut|
|00000a20| 65 20 74 68 65 20 74 65 | 6d 70 6f 72 61 72 79 2d |e the te|mporary-|
|00000a30| 66 69 6c 65 2d 6e 61 6d | 65 2d 62 61 73 65 2e 20 |file-nam|e-base. |
|00000a40| 20 54 68 69 73 20 69 73 | 20 61 20 73 74 72 69 6e | This is| a strin|
|00000a50| 67 20 63 68 6f 73 65 6e | 0d 09 6f 6e 63 65 20 70 |g chosen|..once p|
|00000a60| 65 72 20 63 6f 6d 70 69 | 6c 61 74 69 6f 6e 2e 20 |er compi|lation. |
|00000a70| 20 44 69 66 66 65 72 65 | 6e 74 20 74 65 6d 70 6f | Differe|nt tempo|
|00000a80| 72 61 72 79 20 66 69 6c | 65 20 6e 61 6d 65 73 20 |rary fil|e names |
|00000a90| 61 72 65 20 6d 61 64 65 | 20 62 79 0d 09 63 6f 6e |are made| by..con|
|00000aa0| 63 61 74 65 6e 61 74 69 | 6f 6e 20 6f 66 20 63 6f |catenati|on of co|
|00000ab0| 6e 73 74 61 6e 74 20 73 | 74 72 69 6e 67 73 20 6f |nstant s|trings o|
|00000ac0| 6e 20 74 68 65 20 65 6e | 64 2c 20 61 73 20 69 6e |n the en|d, as in|
|00000ad0| 20 60 25 67 2e 73 27 2e | 0d 09 25 67 20 61 6c 73 | `%g.s'.|..%g als|
|00000ae0| 6f 20 68 61 73 20 74 68 | 65 20 73 61 6d 65 20 65 |o has th|e same e|
|00000af0| 66 66 65 63 74 20 6f 66 | 20 25 64 2e 0d 20 25 64 |ffect of| %d.. %d|
|00000b00| 09 6d 61 72 6b 73 20 74 | 68 65 20 61 72 67 75 6d |.marks t|he argum|
|00000b10| 65 6e 74 20 63 6f 6e 74 | 61 69 6e 69 6e 67 20 6f |ent cont|aining o|
|00000b20| 72 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 74 68 65 20 |r follow|ing the |
|00000b30| 25 64 20 61 73 20 61 0d | 09 74 65 6d 70 6f 72 61 |%d as a.|.tempora|
|00000b40| 72 79 20 66 69 6c 65 20 | 6e 61 6d 65 2c 20 73 6f |ry file |name, so|
|00000b50| 20 74 68 61 74 20 74 68 | 61 74 20 66 69 6c 65 20 | that th|at file |
|00000b60| 77 69 6c 6c 20 62 65 20 | 64 65 6c 65 74 65 64 20 |will be |deleted |
|00000b70| 69 66 20 43 43 20 65 78 | 69 74 73 0d 09 73 75 63 |if CC ex|its..suc|
|00000b80| 63 65 73 73 66 75 6c 6c | 79 2e 20 20 55 6e 6c 69 |cessfull|y. Unli|
|00000b90| 6b 65 20 25 67 2c 20 74 | 68 69 73 20 63 6f 6e 74 |ke %g, t|his cont|
|00000ba0| 72 69 62 75 74 65 73 20 | 6e 6f 20 74 65 78 74 20 |ributes |no text |
|00000bb0| 74 6f 20 74 68 65 20 61 | 72 67 75 6d 65 6e 74 2e |to the a|rgument.|
|00000bc0| 0d 20 25 77 09 6d 61 72 | 6b 73 20 74 68 65 20 61 |. %w.mar|ks the a|
|00000bd0| 72 67 75 6d 65 6e 74 20 | 63 6f 6e 74 61 69 6e 69 |rgument |containi|
|00000be0| 6e 67 20 6f 72 20 66 6f | 6c 6c 6f 77 69 6e 67 20 |ng or fo|llowing |
|00000bf0| 74 68 65 20 25 77 20 61 | 73 20 74 68 65 0d 09 22 |the %w a|s the.."|
|00000c00| 6f 75 74 70 75 74 20 66 | 69 6c 65 22 20 6f 66 20 |output f|ile" of |
|00000c10| 74 68 69 73 20 63 6f 6d | 70 69 6c 61 74 69 6f 6e |this com|pilation|
|00000c20| 2e 20 20 54 68 69 73 20 | 70 75 74 73 20 74 68 65 |. This |puts the|
|00000c30| 20 61 72 67 75 6d 65 6e | 74 0d 09 69 6e 74 6f 20 | argumen|t..into |
|00000c40| 74 68 65 20 73 65 71 75 | 65 6e 63 65 20 6f 66 20 |the sequ|ence of |
|00000c50| 61 72 67 75 6d 65 6e 74 | 73 20 74 68 61 74 20 25 |argument|s that %|
|00000c60| 6f 20 77 69 6c 6c 20 73 | 75 62 73 74 69 74 75 74 |o will s|ubstitut|
|00000c70| 65 20 6c 61 74 65 72 2e | 0d 20 25 6f 09 73 75 62 |e later.|. %o.sub|
|00000c80| 73 74 69 74 75 74 65 73 | 20 74 68 65 20 6e 61 6d |stitutes| the nam|
|00000c90| 65 73 20 6f 66 20 61 6c | 6c 20 74 68 65 20 6f 75 |es of al|l the ou|
|00000ca0| 74 70 75 74 20 66 69 6c | 65 73 2c 20 77 69 74 68 |tput fil|es, with|
|00000cb0| 20 73 70 61 63 65 73 0d | 09 61 75 74 6f 6d 61 74 | spaces.|.automat|
|00000cc0| 69 63 61 6c 6c 79 20 70 | 6c 61 63 65 64 20 61 72 |ically p|laced ar|
|00000cd0| 6f 75 6e 64 20 74 68 65 | 6d 2e 20 20 59 6f 75 20 |ound the|m. You |
|00000ce0| 73 68 6f 75 6c 64 20 77 | 72 69 74 65 20 73 70 61 |should w|rite spa|
|00000cf0| 63 65 73 0d 09 61 72 6f | 75 6e 64 20 74 68 65 20 |ces..aro|und the |
|00000d00| 25 6f 20 61 73 20 77 65 | 6c 6c 20 6f 72 20 74 68 |%o as we|ll or th|
|00000d10| 65 20 72 65 73 75 6c 74 | 73 20 61 72 65 20 75 6e |e result|s are un|
|00000d20| 64 65 66 69 6e 65 64 2e | 0d 09 25 6f 20 69 73 20 |defined.|..%o is |
|00000d30| 66 6f 72 20 75 73 65 20 | 69 6e 20 74 68 65 20 73 |for use |in the s|
|00000d40| 70 65 63 73 20 66 6f 72 | 20 72 75 6e 6e 69 6e 67 |pecs for| running|
|00000d50| 20 74 68 65 20 6c 69 6e | 6b 65 72 2e 0d 09 49 6e | the lin|ker...In|
|00000d60| 70 75 74 20 66 69 6c 65 | 73 20 77 68 6f 73 65 20 |put file|s whose |
|00000d70| 6e 61 6d 65 73 20 68 61 | 76 65 20 6e 6f 20 72 65 |names ha|ve no re|
|00000d80| 63 6f 67 6e 69 7a 65 64 | 20 73 75 66 66 69 78 20 |cognized| suffix |
|00000d90| 61 72 65 20 6e 6f 74 20 | 63 6f 6d 70 69 6c 65 64 |are not |compiled|
|00000da0| 0d 09 61 74 20 61 6c 6c | 2c 20 62 75 74 20 74 68 |..at all|, but th|
|00000db0| 65 79 20 61 72 65 20 69 | 6e 63 6c 75 64 65 64 20 |ey are i|ncluded |
|00000dc0| 61 6d 6f 6e 67 20 74 68 | 65 20 6f 75 74 70 75 74 |among th|e output|
|00000dd0| 20 66 69 6c 65 73 2c 20 | 73 6f 20 74 68 65 79 20 | files, |so they |
|00000de0| 77 69 6c 6c 0d 09 62 65 | 20 6c 69 6e 6b 65 64 2e |will..be| linked.|
|00000df0| 0d 20 25 70 09 73 75 62 | 73 74 69 74 75 74 65 73 |. %p.sub|stitutes|
|00000e00| 20 74 68 65 20 73 74 61 | 6e 64 61 72 64 20 6d 61 | the sta|ndard ma|
|00000e10| 63 72 6f 20 70 72 65 64 | 65 66 69 6e 69 74 69 6f |cro pred|efinitio|
|00000e20| 6e 73 20 66 6f 72 20 74 | 68 65 0d 09 63 75 72 72 |ns for t|he..curr|
|00000e30| 65 6e 74 20 74 61 72 67 | 65 74 20 6d 61 63 68 69 |ent targ|et machi|
|00000e40| 6e 65 2e 20 20 55 73 65 | 20 74 68 69 73 20 77 68 |ne. Use| this wh|
|00000e50| 65 6e 20 72 75 6e 6e 69 | 6e 67 20 63 70 70 2e 0d |en runni|ng cpp..|
|00000e60| 20 25 50 09 6c 69 6b 65 | 20 25 70 2c 20 62 75 74 | %P.like| %p, but|
|00000e70| 20 70 75 74 73 20 60 5f | 5f 27 20 62 65 66 6f 72 | puts `_|_' befor|
|00000e80| 65 20 61 6e 64 20 61 66 | 74 65 72 20 74 68 65 20 |e and af|ter the |
|00000e90| 6e 61 6d 65 20 6f 66 20 | 65 61 63 68 20 6d 61 63 |name of |each mac|
|00000ea0| 72 6f 2e 0d 09 54 68 69 | 73 20 69 73 20 66 6f 72 |ro...Thi|s is for|
|00000eb0| 20 41 4e 53 49 20 43 2e | 0d 20 25 73 20 20 20 20 | ANSI C.|. %s |
|00000ec0| 20 63 75 72 72 65 6e 74 | 20 61 72 67 75 6d 65 6e | current| argumen|
|00000ed0| 74 20 69 73 20 74 68 65 | 20 6e 61 6d 65 20 6f 66 |t is the| name of|
|00000ee0| 20 61 20 6c 69 62 72 61 | 72 79 20 6f 72 20 73 74 | a libra|ry or st|
|00000ef0| 61 72 74 75 70 20 66 69 | 6c 65 20 6f 66 20 73 6f |artup fi|le of so|
|00000f00| 6d 65 20 73 6f 72 74 2e | 0d 20 20 20 20 20 20 20 |me sort.|. |
|00000f10| 20 53 65 61 72 63 68 20 | 66 6f 72 20 74 68 61 74 | Search |for that|
|00000f20| 20 66 69 6c 65 20 69 6e | 20 61 20 73 74 61 6e 64 | file in| a stand|
|00000f30| 61 72 64 20 6c 69 73 74 | 20 6f 66 20 64 69 72 65 |ard list| of dire|
|00000f40| 63 74 6f 72 69 65 73 0d | 09 61 6e 64 20 73 75 62 |ctories.|.and sub|
|00000f50| 73 74 69 74 75 74 65 20 | 74 68 65 20 66 75 6c 6c |stitute |the full|
|00000f60| 20 70 61 74 68 6e 61 6d | 65 20 66 6f 75 6e 64 2e | pathnam|e found.|
|00000f70| 0d 20 25 65 53 54 52 20 | 20 50 72 69 6e 74 20 53 |. %eSTR | Print S|
|00000f80| 54 52 20 61 73 20 61 6e | 20 65 72 72 6f 72 20 6d |TR as an| error m|
|00000f90| 65 73 73 61 67 65 2e 20 | 20 53 54 52 20 69 73 20 |essage. | STR is |
|00000fa0| 74 65 72 6d 69 6e 61 74 | 65 64 20 62 79 20 61 20 |terminat|ed by a |
|00000fb0| 6e 65 77 6c 69 6e 65 2e | 0d 20 20 20 20 20 20 20 |newline.|. |
|00000fc0| 20 55 73 65 20 74 68 69 | 73 20 77 68 65 6e 20 69 | Use thi|s when i|
|00000fd0| 6e 63 6f 6e 73 69 73 74 | 65 6e 74 20 6f 70 74 69 |nconsist|ent opti|
|00000fe0| 6f 6e 73 20 61 72 65 20 | 64 65 74 65 63 74 65 64 |ons are |detected|
|00000ff0| 2e 0d 20 25 61 20 20 20 | 20 20 70 72 6f 63 65 73 |.. %a | proces|
|00001000| 73 20 41 53 4d 5f 53 50 | 45 43 20 61 73 20 61 20 |s ASM_SP|EC as a |
|00001010| 73 70 65 63 2e 0d 20 20 | 20 20 20 20 20 20 54 68 |spec.. | Th|
|00001020| 69 73 20 61 6c 6c 6f 77 | 73 20 63 6f 6e 66 69 67 |is allow|s config|
|00001030| 2e 68 20 74 6f 20 73 70 | 65 63 69 66 79 20 70 61 |.h to sp|ecify pa|
|00001040| 72 74 20 6f 66 20 74 68 | 65 20 73 70 65 63 20 66 |rt of th|e spec f|
|00001050| 6f 72 20 72 75 6e 6e 69 | 6e 67 20 61 73 2e 0d 20 |or runni|ng as.. |
|00001060| 25 6c 20 20 20 20 20 70 | 72 6f 63 65 73 73 20 4c |%l p|rocess L|
|00001070| 49 4e 4b 5f 53 50 45 43 | 20 61 73 20 61 20 73 70 |INK_SPEC| as a sp|
|00001080| 65 63 2e 0d 20 25 4c 20 | 20 20 20 20 70 72 6f 63 |ec.. %L | proc|
|00001090| 65 73 73 20 4c 49 42 5f | 53 50 45 43 20 61 73 20 |ess LIB_|SPEC as |
|000010a0| 61 20 73 70 65 63 2e 0d | 20 25 53 20 20 20 20 20 |a spec..| %S |
|000010b0| 70 72 6f 63 65 73 73 20 | 53 54 41 52 54 46 49 4c |process |STARTFIL|
|000010c0| 45 5f 53 50 45 43 20 61 | 73 20 61 20 73 70 65 63 |E_SPEC a|s a spec|
|000010d0| 2e 20 20 41 20 63 61 70 | 69 74 61 6c 20 53 20 69 |. A cap|ital S i|
|000010e0| 73 20 61 63 74 75 61 6c | 6c 79 20 75 73 65 64 20 |s actual|ly used |
|000010f0| 68 65 72 65 2e 0d 20 25 | 63 09 70 72 6f 63 65 73 |here.. %|c.proces|
|00001100| 73 20 53 49 47 4e 45 44 | 5f 43 48 41 52 5f 53 50 |s SIGNED|_CHAR_SP|
|00001110| 45 43 20 61 73 20 61 20 | 73 70 65 63 2e 0d 20 25 |EC as a |spec.. %|
|00001120| 43 20 20 20 20 20 70 72 | 6f 63 65 73 73 20 43 50 |C pr|ocess CP|
|00001130| 50 5f 53 50 45 43 20 61 | 73 20 61 20 73 70 65 63 |P_SPEC a|s a spec|
|00001140| 2e 20 20 41 20 63 61 70 | 69 74 61 6c 20 43 20 69 |. A cap|ital C i|
|00001150| 73 20 61 63 74 75 61 6c | 6c 79 20 75 73 65 64 20 |s actual|ly used |
|00001160| 68 65 72 65 2e 0d 20 25 | 31 09 70 72 6f 63 65 73 |here.. %|1.proces|
|00001170| 73 20 43 43 31 5f 53 50 | 45 43 20 61 73 20 61 20 |s CC1_SP|EC as a |
|00001180| 73 70 65 63 2e 0d 20 25 | 7b 53 7d 20 20 20 73 75 |spec.. %|{S} su|
|00001190| 62 73 74 69 74 75 74 65 | 73 20 74 68 65 20 2d 53 |bstitute|s the -S|
|000011a0| 20 73 77 69 74 63 68 2c | 20 69 66 20 74 68 61 74 | switch,| if that|
|000011b0| 20 73 77 69 74 63 68 20 | 77 61 73 20 67 69 76 65 | switch |was give|
|000011c0| 6e 20 74 6f 20 43 43 2e | 0d 09 49 66 20 74 68 61 |n to CC.|..If tha|
|000011d0| 74 20 73 77 69 74 63 68 | 20 77 61 73 20 6e 6f 74 |t switch| was not|
|000011e0| 20 73 70 65 63 69 66 69 | 65 64 2c 20 74 68 69 73 | specifi|ed, this|
|000011f0| 20 73 75 62 73 74 69 74 | 75 74 65 73 20 6e 6f 74 | substit|utes not|
|00001200| 68 69 6e 67 2e 0d 09 48 | 65 72 65 20 53 20 69 73 |hing...H|ere S is|
|00001210| 20 61 20 6d 65 74 61 73 | 79 6e 74 61 63 74 69 63 | a metas|yntactic|
|00001220| 20 76 61 72 69 61 62 6c | 65 2e 0d 20 25 7b 53 2a | variabl|e.. %{S*|
|00001230| 7d 20 20 73 75 62 73 74 | 69 74 75 74 65 73 20 61 |} subst|itutes a|
|00001240| 6c 6c 20 74 68 65 20 73 | 77 69 74 63 68 65 73 20 |ll the s|witches |
|00001250| 73 70 65 63 69 66 69 65 | 64 20 74 6f 20 43 43 20 |specifie|d to CC |
|00001260| 77 68 6f 73 65 20 6e 61 | 6d 65 73 20 73 74 61 72 |whose na|mes star|
|00001270| 74 0d 09 77 69 74 68 20 | 2d 53 2e 20 20 54 68 69 |t..with |-S. Thi|
|00001280| 73 20 69 73 20 75 73 65 | 64 20 66 6f 72 20 2d 6f |s is use|d for -o|
|00001290| 2c 20 2d 44 2c 20 2d 49 | 2c 20 65 74 63 3b 20 73 |, -D, -I|, etc; s|
|000012a0| 77 69 74 63 68 65 73 20 | 74 68 61 74 20 74 61 6b |witches |that tak|
|000012b0| 65 0d 09 61 72 67 75 6d | 65 6e 74 73 2e 20 20 43 |e..argum|ents. C|
|000012c0| 43 20 63 6f 6e 73 69 64 | 65 72 73 20 60 2d 6f 20 |C consid|ers `-o |
|000012d0| 66 6f 6f 27 20 61 73 20 | 62 65 69 6e 67 20 6f 6e |foo' as |being on|
|000012e0| 65 20 73 77 69 74 63 68 | 20 77 68 6f 73 65 0d 09 |e switch| whose..|
|000012f0| 6e 61 6d 65 20 73 74 61 | 72 74 73 20 77 69 74 68 |name sta|rts with|
|00001300| 20 60 6f 27 2e 20 20 25 | 7b 6f 2a 7d 20 77 6f 75 | `o'. %|{o*} wou|
|00001310| 6c 64 20 73 75 62 73 74 | 69 74 75 74 65 20 74 68 |ld subst|itute th|
|00001320| 69 73 20 74 65 78 74 2c | 0d 09 69 6e 63 6c 75 64 |is text,|..includ|
|00001330| 69 6e 67 20 74 68 65 20 | 73 70 61 63 65 3b 20 74 |ing the |space; t|
|00001340| 68 75 73 2c 20 74 77 6f | 20 61 72 67 75 6d 65 6e |hus, two| argumen|
|00001350| 74 73 20 77 6f 75 6c 64 | 20 62 65 20 67 65 6e 65 |ts would| be gene|
|00001360| 72 61 74 65 64 2e 0d 20 | 25 7b 53 3a 58 7d 20 73 |rated.. |%{S:X} s|
|00001370| 75 62 73 74 69 74 75 74 | 65 73 20 58 2c 20 62 75 |ubstitut|es X, bu|
|00001380| 74 20 6f 6e 6c 79 20 69 | 66 20 74 68 65 20 2d 53 |t only i|f the -S|
|00001390| 20 73 77 69 74 63 68 20 | 77 61 73 20 67 69 76 65 | switch |was give|
|000013a0| 6e 20 74 6f 20 43 43 2e | 0d 20 25 7b 21 53 3a 58 |n to CC.|. %{!S:X|
|000013b0| 7d 20 73 75 62 73 74 69 | 74 75 74 65 73 20 58 2c |} substi|tutes X,|
|000013c0| 20 62 75 74 20 6f 6e 6c | 79 20 69 66 20 74 68 65 | but onl|y if the|
|000013d0| 20 2d 53 20 73 77 69 74 | 63 68 20 77 61 73 20 4e | -S swit|ch was N|
|000013e0| 4f 54 20 67 69 76 65 6e | 20 74 6f 20 43 43 2e 0d |OT given| to CC..|
|000013f0| 20 25 7b 7c 53 3a 58 7d | 20 6c 69 6b 65 20 25 7b | %{|S:X}| like %{|
|00001400| 53 3a 58 7d 2c 20 62 75 | 74 20 69 66 20 6e 6f 20 |S:X}, bu|t if no |
|00001410| 53 20 73 77 69 74 63 68 | 2c 20 73 75 62 73 74 69 |S switch|, substi|
|00001420| 74 75 74 65 20 60 2d 27 | 2e 0d 20 25 7b 7c 21 53 |tute `-'|.. %{|!S|
|00001430| 3a 58 7d 20 6c 69 6b 65 | 20 25 7b 21 53 3a 58 7d |:X} like| %{!S:X}|
|00001440| 2c 20 62 75 74 20 69 66 | 20 74 68 65 72 65 20 69 |, but if| there i|
|00001450| 73 20 61 6e 20 53 20 73 | 77 69 74 63 68 2c 20 73 |s an S s|witch, s|
|00001460| 75 62 73 74 69 74 75 74 | 65 20 60 2d 27 2e 0d 0d |ubstitut|e `-'...|
|00001470| 54 68 65 20 63 6f 6e 64 | 69 74 69 6f 6e 61 6c 20 |The cond|itional |
|00001480| 74 65 78 74 20 58 20 69 | 6e 20 61 20 25 7b 53 3a |text X i|n a %{S:|
|00001490| 58 7d 20 6f 72 20 25 7b | 21 53 3a 58 7d 20 63 6f |X} or %{|!S:X} co|
|000014a0| 6e 73 74 72 75 63 74 20 | 6d 61 79 20 63 6f 6e 74 |nstruct |may cont|
|000014b0| 61 69 6e 0d 6f 74 68 65 | 72 20 6e 65 73 74 65 64 |ain.othe|r nested|
|000014c0| 20 25 20 63 6f 6e 73 74 | 72 75 63 74 73 20 6f 72 | % const|ructs or|
|000014d0| 20 73 70 61 63 65 73 2c | 20 6f 72 20 65 76 65 6e | spaces,| or even|
|000014e0| 20 6e 65 77 6c 69 6e 65 | 73 2e 0d 54 68 65 79 20 | newline|s..They |
|000014f0| 61 72 65 20 70 72 6f 63 | 65 73 73 65 64 20 61 73 |are proc|essed as|
|00001500| 20 75 73 75 61 6c 2c 20 | 61 73 20 64 65 73 63 72 | usual, |as descr|
|00001510| 69 62 65 64 20 61 62 6f | 76 65 2e 0d 0d 54 68 65 |ibed abo|ve...The|
|00001520| 20 63 68 61 72 61 63 74 | 65 72 20 7c 20 69 73 20 | charact|er | is |
|00001530| 75 73 65 64 20 74 6f 20 | 69 6e 64 69 63 61 74 65 |used to |indicate|
|00001540| 20 74 68 61 74 20 61 20 | 63 6f 6d 6d 61 6e 64 20 | that a |command |
|00001550| 73 68 6f 75 6c 64 20 62 | 65 20 70 69 70 65 64 20 |should b|e piped |
|00001560| 74 6f 0d 74 68 65 20 66 | 6f 6c 6c 6f 77 69 6e 67 |to.the f|ollowing|
|00001570| 20 63 6f 6d 6d 61 6e 64 | 2c 20 62 75 74 20 6f 6e | command|, but on|
|00001580| 6c 79 20 69 66 20 2d 70 | 69 70 65 20 69 73 20 73 |ly if -p|ipe is s|
|00001590| 70 65 63 69 66 69 65 64 | 2e 0d 0d 4e 6f 74 65 20 |pecified|...Note |
|000015a0| 74 68 61 74 20 69 74 20 | 69 73 20 62 75 69 6c 74 |that it |is built|
|000015b0| 20 69 6e 74 6f 20 43 43 | 20 77 68 69 63 68 20 73 | into CC| which s|
|000015c0| 77 69 74 63 68 65 73 20 | 74 61 6b 65 20 61 72 67 |witches |take arg|
|000015d0| 75 6d 65 6e 74 73 20 61 | 6e 64 20 77 68 69 63 68 |uments a|nd which|
|000015e0| 0d 64 6f 20 6e 6f 74 2e | 20 20 59 6f 75 20 6d 69 |.do not.| You mi|
|000015f0| 67 68 74 20 74 68 69 6e | 6b 20 69 74 20 77 6f 75 |ght thin|k it wou|
|00001600| 6c 64 20 62 65 20 75 73 | 65 66 75 6c 20 74 6f 20 |ld be us|eful to |
|00001610| 67 65 6e 65 72 61 6c 69 | 7a 65 20 74 68 69 73 20 |generali|ze this |
|00001620| 74 6f 0d 61 6c 6c 6f 77 | 20 65 61 63 68 20 63 6f |to.allow| each co|
|00001630| 6d 70 69 6c 65 72 27 73 | 20 73 70 65 63 20 74 6f |mpiler's| spec to|
|00001640| 20 73 61 79 20 77 68 69 | 63 68 20 73 77 69 74 63 | say whi|ch switc|
|00001650| 68 65 73 20 74 61 6b 65 | 20 61 72 67 75 6d 65 6e |hes take| argumen|
|00001660| 74 73 2e 20 20 42 75 74 | 0d 74 68 69 73 20 63 61 |ts. But|.this ca|
|00001670| 6e 6e 6f 74 20 62 65 20 | 64 6f 6e 65 20 69 6e 20 |nnot be |done in |
|00001680| 61 20 63 6f 6e 73 69 73 | 74 65 6e 74 20 66 61 73 |a consis|tent fas|
|00001690| 68 69 6f 6e 2e 20 20 43 | 43 20 63 61 6e 6e 6f 74 |hion. C|C cannot|
|000016a0| 20 65 76 65 6e 20 64 65 | 63 69 64 65 0d 77 68 69 | even de|cide.whi|
|000016b0| 63 68 20 69 6e 70 75 74 | 20 66 69 6c 65 73 20 68 |ch input| files h|
|000016c0| 61 76 65 20 62 65 65 6e | 20 73 70 65 63 69 66 69 |ave been| specifi|
|000016d0| 65 64 20 77 69 74 68 6f | 75 74 20 6b 6e 6f 77 69 |ed witho|ut knowi|
|000016e0| 6e 67 20 77 68 69 63 68 | 20 73 77 69 74 63 68 65 |ng which| switche|
|000016f0| 73 0d 74 61 6b 65 20 61 | 72 67 75 6d 65 6e 74 73 |s.take a|rguments|
|00001700| 2c 20 61 6e 64 20 69 74 | 20 6d 75 73 74 20 6b 6e |, and it| must kn|
|00001710| 6f 77 20 77 68 69 63 68 | 20 69 6e 70 75 74 20 66 |ow which| input f|
|00001720| 69 6c 65 73 20 74 6f 20 | 63 6f 6d 70 69 6c 65 20 |iles to |compile |
|00001730| 69 6e 20 6f 72 64 65 72 | 0d 74 6f 20 74 65 6c 6c |in order|.to tell|
|00001740| 20 77 68 69 63 68 20 63 | 6f 6d 70 69 6c 65 72 73 | which c|ompilers|
|00001750| 20 74 6f 20 72 75 6e 2e | 0d 0d 43 43 20 61 6c 73 | to run.|..CC als|
|00001760| 6f 20 6b 6e 6f 77 73 20 | 69 6d 70 6c 69 63 69 74 |o knows |implicit|
|00001770| 6c 79 20 74 68 61 74 20 | 61 72 67 75 6d 65 6e 74 |ly that |argument|
|00001780| 73 20 73 74 61 72 74 69 | 6e 67 20 69 6e 20 60 2d |s starti|ng in `-|
|00001790| 6c 27 20 61 72 65 20 74 | 6f 0d 62 65 20 74 72 65 |l' are t|o.be tre|
|000017a0| 61 74 65 64 20 61 73 20 | 63 6f 6d 70 69 6c 65 72 |ated as |compiler|
|000017b0| 20 6f 75 74 70 75 74 20 | 66 69 6c 65 73 2c 20 61 | output |files, a|
|000017c0| 6e 64 20 70 61 73 73 65 | 64 20 74 6f 20 74 68 65 |nd passe|d to the|
|000017d0| 20 6c 69 6e 6b 65 72 20 | 69 6e 20 74 68 65 69 72 | linker |in their|
|000017e0| 20 70 72 6f 70 65 72 0d | 70 6f 73 69 74 69 6f 6e | proper.|position|
|000017f0| 20 61 6d 6f 6e 67 20 74 | 68 65 20 6f 74 68 65 72 | among t|he other|
|00001800| 20 6f 75 74 70 75 74 20 | 66 69 6c 65 73 2e 0d 0d | output |files...|
|00001810| 2a 2f 0d 0d 23 69 6e 63 | 6c 75 64 65 20 3c 73 74 |*/..#inc|lude <st|
|00001820| 64 69 6f 2e 68 3e 0d 23 | 69 6e 63 6c 75 64 65 20 |dio.h>.#|include |
|00001830| 3c 73 79 73 2f 74 79 70 | 65 73 2e 68 3e 0d 23 69 |<sys/typ|es.h>.#i|
|00001840| 6e 63 6c 75 64 65 20 3c | 73 69 67 6e 61 6c 2e 68 |nclude <|signal.h|
|00001850| 3e 0d 23 69 6e 63 6c 75 | 64 65 20 3c 73 79 73 2f |>.#inclu|de <sys/|
|00001860| 66 69 6c 65 2e 68 3e 0d | 0d 23 69 6e 63 6c 75 64 |file.h>.|.#includ|
|00001870| 65 20 22 63 6f 6e 66 69 | 67 2e 68 22 0d 23 69 6e |e "confi|g.h".#in|
|00001880| 63 6c 75 64 65 20 22 6f | 62 73 74 61 63 6b 2e 68 |clude "o|bstack.h|
|00001890| 22 0d 23 69 6e 63 6c 75 | 64 65 20 22 67 76 61 72 |".#inclu|de "gvar|
|000018a0| 61 72 67 73 2e 68 22 0d | 0d 23 69 66 64 65 66 20 |args.h".|.#ifdef |
|000018b0| 55 53 47 0d 23 64 65 66 | 69 6e 65 20 52 5f 4f 4b |USG.#def|ine R_OK|
|000018c0| 20 34 0d 23 64 65 66 69 | 6e 65 20 57 5f 4f 4b 20 | 4.#defi|ne W_OK |
|000018d0| 32 0d 23 64 65 66 69 6e | 65 20 58 5f 4f 4b 20 31 |2.#defin|e X_OK 1|
|000018e0| 0d 23 64 65 66 69 6e 65 | 20 76 66 6f 72 6b 20 66 |.#define| vfork f|
|000018f0| 6f 72 6b 0d 23 65 6e 64 | 69 66 20 2f 2a 20 55 53 |ork.#end|if /* US|
|00001900| 47 20 2a 2f 0d 0d 23 64 | 65 66 69 6e 65 20 6f 62 |G */..#d|efine ob|
|00001910| 73 74 61 63 6b 5f 63 68 | 75 6e 6b 5f 61 6c 6c 6f |stack_ch|unk_allo|
|00001920| 63 20 78 6d 61 6c 6c 6f | 63 0d 23 64 65 66 69 6e |c xmallo|c.#defin|
|00001930| 65 20 6f 62 73 74 61 63 | 6b 5f 63 68 75 6e 6b 5f |e obstac|k_chunk_|
|00001940| 66 72 65 65 20 66 72 65 | 65 0d 65 78 74 65 72 6e |free fre|e.extern|
|00001950| 20 69 6e 74 20 78 6d 61 | 6c 6c 6f 63 20 28 29 3b | int xma|lloc ();|
|00001960| 0d 65 78 74 65 72 6e 20 | 76 6f 69 64 20 66 72 65 |.extern |void fre|
|00001970| 65 20 28 29 3b 0d 0d 2f | 2a 20 49 66 20 61 20 73 |e ();../|* If a s|
|00001980| 74 61 67 65 20 6f 66 20 | 63 6f 6d 70 69 6c 61 74 |tage of |compilat|
|00001990| 69 6f 6e 20 72 65 74 75 | 72 6e 73 20 61 6e 20 65 |ion retu|rns an e|
|000019a0| 78 69 74 20 73 74 61 74 | 75 73 20 3e 3d 20 31 2c |xit stat|us >= 1,|
|000019b0| 0d 20 20 20 63 6f 6d 70 | 69 6c 61 74 69 6f 6e 20 |. comp|ilation |
|000019c0| 6f 66 20 74 68 61 74 20 | 66 69 6c 65 20 63 65 61 |of that |file cea|
|000019d0| 73 65 73 2e 20 20 2a 2f | 0d 0d 23 64 65 66 69 6e |ses. */|..#defin|
|000019e0| 65 20 4d 49 4e 5f 46 41 | 54 41 4c 5f 53 54 41 54 |e MIN_FA|TAL_STAT|
|000019f0| 55 53 20 31 0d 0d 2f 2a | 20 54 68 69 73 20 69 73 |US 1../*| This is|
|00001a00| 20 74 68 65 20 6f 62 73 | 74 61 63 6b 20 77 68 69 | the obs|tack whi|
|00001a10| 63 68 20 77 65 20 75 73 | 65 20 74 6f 20 61 6c 6c |ch we us|e to all|
|00001a20| 6f 63 61 74 65 20 6d 61 | 6e 79 20 73 74 72 69 6e |ocate ma|ny strin|
|00001a30| 67 73 2e 20 20 2a 2f 0d | 0d 73 74 72 75 63 74 20 |gs. */.|.struct |
|00001a40| 6f 62 73 74 61 63 6b 20 | 6f 62 73 74 61 63 6b 3b |obstack |obstack;|
|00001a50| 0d 0d 63 68 61 72 20 2a | 68 61 6e 64 6c 65 5f 62 |..char *|handle_b|
|00001a60| 72 61 63 65 73 20 28 29 | 3b 0d 63 68 61 72 20 2a |races ()|;.char *|
|00001a70| 73 61 76 65 5f 73 74 72 | 69 6e 67 20 28 29 3b 0d |save_str|ing ();.|
|00001a80| 63 68 61 72 20 2a 63 6f | 6e 63 61 74 20 28 29 3b |char *co|ncat ();|
|00001a90| 0d 69 6e 74 20 64 6f 5f | 73 70 65 63 20 28 29 3b |.int do_|spec ();|
|00001aa0| 0d 69 6e 74 20 64 6f 5f | 73 70 65 63 5f 31 20 28 |.int do_|spec_1 (|
|00001ab0| 29 3b 0d 63 68 61 72 20 | 2a 66 69 6e 64 5f 66 69 |);.char |*find_fi|
|00001ac0| 6c 65 20 28 29 3b 0d 73 | 74 61 74 69 63 20 63 68 |le ();.s|tatic ch|
|00001ad0| 61 72 20 2a 66 69 6e 64 | 5f 65 78 65 63 5f 66 69 |ar *find|_exec_fi|
|00001ae0| 6c 65 20 28 29 3b 0d 76 | 6f 69 64 20 76 61 6c 69 |le ();.v|oid vali|
|00001af0| 64 61 74 65 5f 73 77 69 | 74 63 68 65 73 20 28 29 |date_swi|tches ()|
|00001b00| 3b 0d 76 6f 69 64 20 76 | 61 6c 69 64 61 74 65 5f |;.void v|alidate_|
|00001b10| 61 6c 6c 5f 73 77 69 74 | 63 68 65 73 20 28 29 3b |all_swit|ches ();|
|00001b20| 0d 76 6f 69 64 20 66 61 | 6e 63 79 5f 61 62 6f 72 |.void fa|ncy_abor|
|00001b30| 74 20 28 29 3b 0d 0d 2f | 2a 20 63 6f 6e 66 69 67 |t ();../|* config|
|00001b40| 2e 68 20 63 61 6e 20 64 | 65 66 69 6e 65 20 41 53 |.h can d|efine AS|
|00001b50| 4d 5f 53 50 45 43 20 74 | 6f 20 70 72 6f 76 69 64 |M_SPEC t|o provid|
|00001b60| 65 20 65 78 74 72 61 20 | 61 72 67 73 20 74 6f 20 |e extra |args to |
|00001b70| 74 68 65 20 61 73 73 65 | 6d 62 6c 65 72 0d 20 20 |the asse|mbler. |
|00001b80| 20 6f 72 20 65 78 74 72 | 61 20 73 77 69 74 63 68 | or extr|a switch|
|00001b90| 2d 74 72 61 6e 73 6c 61 | 74 69 6f 6e 73 2e 20 20 |-transla|tions. |
|00001ba0| 2a 2f 0d 23 69 66 6e 64 | 65 66 20 41 53 4d 5f 53 |*/.#ifnd|ef ASM_S|
|00001bb0| 50 45 43 0d 23 64 65 66 | 69 6e 65 20 41 53 4d 5f |PEC.#def|ine ASM_|
|00001bc0| 53 50 45 43 20 22 22 0d | 23 65 6e 64 69 66 0d 0d |SPEC "".|#endif..|
|00001bd0| 2f 2a 20 63 6f 6e 66 69 | 67 2e 68 20 63 61 6e 20 |/* confi|g.h can |
|00001be0| 64 65 66 69 6e 65 20 43 | 50 50 5f 53 50 45 43 20 |define C|PP_SPEC |
|00001bf0| 74 6f 20 70 72 6f 76 69 | 64 65 20 65 78 74 72 61 |to provi|de extra|
|00001c00| 20 61 72 67 73 20 74 6f | 20 74 68 65 20 43 20 70 | args to| the C p|
|00001c10| 72 65 70 72 6f 63 65 73 | 73 6f 72 0d 20 20 20 6f |reproces|sor. o|
|00001c20| 72 20 65 78 74 72 61 20 | 73 77 69 74 63 68 2d 74 |r extra |switch-t|
|00001c30| 72 61 6e 73 6c 61 74 69 | 6f 6e 73 2e 20 20 2a 2f |ranslati|ons. */|
|00001c40| 0d 23 69 66 6e 64 65 66 | 20 43 50 50 5f 53 50 45 |.#ifndef| CPP_SPE|
|00001c50| 43 0d 23 64 65 66 69 6e | 65 20 43 50 50 5f 53 50 |C.#defin|e CPP_SP|
|00001c60| 45 43 20 22 22 0d 23 65 | 6e 64 69 66 0d 0d 2f 2a |EC "".#e|ndif../*|
|00001c70| 20 63 6f 6e 66 69 67 2e | 68 20 63 61 6e 20 64 65 | config.|h can de|
|00001c80| 66 69 6e 65 20 43 43 31 | 5f 53 50 45 43 20 74 6f |fine CC1|_SPEC to|
|00001c90| 20 70 72 6f 76 69 64 65 | 20 65 78 74 72 61 20 61 | provide| extra a|
|00001ca0| 72 67 73 20 74 6f 20 63 | 63 31 0d 20 20 20 6f 72 |rgs to c|c1. or|
|00001cb0| 20 65 78 74 72 61 20 73 | 77 69 74 63 68 2d 74 72 | extra s|witch-tr|
|00001cc0| 61 6e 73 6c 61 74 69 6f | 6e 73 2e 20 20 2a 2f 0d |anslatio|ns. */.|
|00001cd0| 23 69 66 6e 64 65 66 20 | 43 43 31 5f 53 50 45 43 |#ifndef |CC1_SPEC|
|00001ce0| 0d 23 64 65 66 69 6e 65 | 20 43 43 31 5f 53 50 45 |.#define| CC1_SPE|
|00001cf0| 43 20 22 22 0d 23 65 6e | 64 69 66 0d 0d 2f 2a 20 |C "".#en|dif../* |
|00001d00| 63 6f 6e 66 69 67 2e 68 | 20 63 61 6e 20 64 65 66 |config.h| can def|
|00001d10| 69 6e 65 20 4c 49 4e 4b | 5f 53 50 45 43 20 74 6f |ine LINK|_SPEC to|
|00001d20| 20 70 72 6f 76 69 64 65 | 20 65 78 74 72 61 20 61 | provide| extra a|
|00001d30| 72 67 73 20 74 6f 20 74 | 68 65 20 6c 69 6e 6b 65 |rgs to t|he linke|
|00001d40| 72 0d 20 20 20 6f 72 20 | 65 78 74 72 61 20 73 77 |r. or |extra sw|
|00001d50| 69 74 63 68 2d 74 72 61 | 6e 73 6c 61 74 69 6f 6e |itch-tra|nslation|
|00001d60| 73 2e 20 20 2a 2f 0d 23 | 69 66 6e 64 65 66 20 4c |s. */.#|ifndef L|
|00001d70| 49 4e 4b 5f 53 50 45 43 | 0d 23 64 65 66 69 6e 65 |INK_SPEC|.#define|
|00001d80| 20 4c 49 4e 4b 5f 53 50 | 45 43 20 22 22 0d 23 65 | LINK_SP|EC "".#e|
|00001d90| 6e 64 69 66 0d 0d 2f 2a | 20 63 6f 6e 66 69 67 2e |ndif../*| config.|
|00001da0| 68 20 63 61 6e 20 64 65 | 66 69 6e 65 20 4c 49 42 |h can de|fine LIB|
|00001db0| 5f 53 50 45 43 20 74 6f | 20 6f 76 65 72 72 69 64 |_SPEC to| overrid|
|00001dc0| 65 20 74 68 65 20 64 65 | 66 61 75 6c 74 20 6c 69 |e the de|fault li|
|00001dd0| 62 72 61 72 69 65 73 2e | 20 20 2a 2f 0d 23 69 66 |braries.| */.#if|
|00001de0| 6e 64 65 66 20 4c 49 42 | 5f 53 50 45 43 0d 23 64 |ndef LIB|_SPEC.#d|
|00001df0| 65 66 69 6e 65 20 4c 49 | 42 5f 53 50 45 43 20 22 |efine LI|B_SPEC "|
|00001e00| 25 7b 21 70 3a 25 7b 21 | 70 67 3a 2d 6c 63 7d 7d |%{!p:%{!|pg:-lc}}|
|00001e10| 25 7b 70 3a 2d 6c 63 5f | 70 7d 25 7b 70 67 3a 2d |%{p:-lc_|p}%{pg:-|
|00001e20| 6c 63 5f 70 7d 22 0d 23 | 65 6e 64 69 66 0d 0d 2f |lc_p}".#|endif../|
|00001e30| 2a 20 63 6f 6e 66 69 67 | 2e 68 20 63 61 6e 20 64 |* config|.h can d|
|00001e40| 65 66 69 6e 65 20 53 54 | 41 52 54 46 49 4c 45 5f |efine ST|ARTFILE_|
|00001e50| 53 50 45 43 20 74 6f 20 | 6f 76 65 72 72 69 64 65 |SPEC to |override|
|00001e60| 20 74 68 65 20 64 65 66 | 61 75 6c 74 20 63 72 74 | the def|ault crt|
|00001e70| 30 20 66 69 6c 65 73 2e | 20 20 2a 2f 0d 23 69 66 |0 files.| */.#if|
|00001e80| 6e 64 65 66 20 53 54 41 | 52 54 46 49 4c 45 5f 53 |ndef STA|RTFILE_S|
|00001e90| 50 45 43 0d 23 64 65 66 | 69 6e 65 20 53 54 41 52 |PEC.#def|ine STAR|
|00001ea0| 54 46 49 4c 45 5f 53 50 | 45 43 20 20 5c 0d 20 20 |TFILE_SP|EC \. |
|00001eb0| 22 25 7b 70 67 3a 67 63 | 72 74 30 2e 6f 25 73 7d |"%{pg:gc|rt0.o%s}|
|00001ec0| 25 7b 21 70 67 3a 25 7b | 70 3a 6d 63 72 74 30 2e |%{!pg:%{|p:mcrt0.|
|00001ed0| 6f 25 73 7d 25 7b 21 70 | 3a 63 72 74 30 2e 6f 25 |o%s}%{!p|:crt0.o%|
|00001ee0| 73 7d 7d 22 0d 23 65 6e | 64 69 66 0d 0d 2f 2a 20 |s}}".#en|dif../* |
|00001ef0| 54 68 69 73 20 73 70 65 | 63 20 69 73 20 75 73 65 |This spe|c is use|
|00001f00| 64 20 66 6f 72 20 74 65 | 6c 6c 69 6e 67 20 63 70 |d for te|lling cp|
|00001f10| 70 20 77 68 65 74 68 65 | 72 20 63 68 61 72 20 69 |p whethe|r char i|
|00001f20| 73 20 73 69 67 6e 65 64 | 20 6f 72 20 6e 6f 74 2e |s signed| or not.|
|00001f30| 20 20 2a 2f 0d 23 64 65 | 66 69 6e 65 20 53 49 47 | */.#de|fine SIG|
|00001f40| 4e 45 44 5f 43 48 41 52 | 5f 53 50 45 43 20 20 5c |NED_CHAR|_SPEC \|
|00001f50| 0d 20 20 28 44 45 46 41 | 55 4c 54 5f 53 49 47 4e |. (DEFA|ULT_SIGN|
|00001f60| 45 44 5f 43 48 41 52 20 | 3f 20 22 25 7b 66 75 6e |ED_CHAR |? "%{fun|
|00001f70| 73 69 67 6e 65 64 2d 63 | 68 61 72 3a 2d 44 5f 5f |signed-c|har:-D__|
|00001f80| 43 48 41 52 5f 55 4e 53 | 49 47 4e 45 44 5f 5f 7d |CHAR_UNS|IGNED__}|
|00001f90| 22 09 5c 0d 20 20 20 3a | 20 22 25 7b 21 66 73 69 |".\. :| "%{!fsi|
|00001fa0| 67 6e 65 64 2d 63 68 61 | 72 3a 2d 44 5f 5f 43 48 |gned-cha|r:-D__CH|
|00001fb0| 41 52 5f 55 4e 53 49 47 | 4e 45 44 5f 5f 7d 22 29 |AR_UNSIG|NED__}")|
|00001fc0| 0d 0d 2f 2a 20 54 68 69 | 73 20 64 65 66 69 6e 65 |../* Thi|s define|
|00001fd0| 73 20 77 68 69 63 68 20 | 73 77 69 74 63 68 20 6c |s which |switch l|
|00001fe0| 65 74 74 65 72 73 20 74 | 61 6b 65 20 61 72 67 75 |etters t|ake argu|
|00001ff0| 6d 65 6e 74 73 2e 20 20 | 2a 2f 0d 0d 23 69 66 6e |ments. |*/..#ifn|
|00002000| 64 65 66 20 53 57 49 54 | 43 48 5f 54 41 4b 45 53 |def SWIT|CH_TAKES|
|00002010| 5f 41 52 47 0d 23 64 65 | 66 69 6e 65 20 53 57 49 |_ARG.#de|fine SWI|
|00002020| 54 43 48 5f 54 41 4b 45 | 53 5f 41 52 47 28 43 48 |TCH_TAKE|S_ARG(CH|
|00002030| 41 52 29 20 20 20 20 20 | 20 5c 0d 20 20 28 28 43 |AR) | \. ((C|
|00002040| 48 41 52 29 20 3d 3d 20 | 27 44 27 20 7c 7c 20 28 |HAR) == |'D' || (|
|00002050| 43 48 41 52 29 20 3d 3d | 20 27 55 27 20 7c 7c 20 |CHAR) ==| 'U' || |
|00002060| 28 43 48 41 52 29 20 3d | 3d 20 27 6f 27 20 5c 0d |(CHAR) =|= 'o' \.|
|00002070| 20 20 20 7c 7c 20 28 43 | 48 41 52 29 20 3d 3d 20 | || (C|HAR) == |
|00002080| 27 65 27 20 7c 7c 20 28 | 43 48 41 52 29 20 3d 3d |'e' || (|CHAR) ==|
|00002090| 20 27 54 27 20 7c 7c 20 | 28 43 48 41 52 29 20 3d | 'T' || |(CHAR) =|
|000020a0| 3d 20 27 75 27 20 5c 0d | 20 20 20 7c 7c 20 28 43 |= 'u' \.| || (C|
|000020b0| 48 41 52 29 20 3d 3d 20 | 27 49 27 20 7c 7c 20 28 |HAR) == |'I' || (|
|000020c0| 43 48 41 52 29 20 3d 3d | 20 27 59 27 20 7c 7c 20 |CHAR) ==| 'Y' || |
|000020d0| 28 43 48 41 52 29 20 3d | 3d 20 27 6d 27 20 5c 0d |(CHAR) =|= 'm' \.|
|000020e0| 20 20 20 7c 7c 20 28 43 | 48 41 52 29 20 3d 3d 20 | || (C|HAR) == |
|000020f0| 27 4c 27 20 7c 7c 20 28 | 43 48 41 52 29 20 3d 3d |'L' || (|CHAR) ==|
|00002100| 20 27 69 27 20 7c 7c 20 | 28 43 48 41 52 29 20 3d | 'i' || |(CHAR) =|
|00002110| 3d 20 27 41 27 29 0d 23 | 65 6e 64 69 66 0d 0d 2f |= 'A').#|endif../|
|00002120| 2a 20 54 68 69 73 20 64 | 65 66 69 6e 65 73 20 77 |* This d|efines w|
|00002130| 68 69 63 68 20 6d 75 6c | 74 69 2d 6c 65 74 74 65 |hich mul|ti-lette|
|00002140| 72 20 73 77 69 74 63 68 | 65 73 20 74 61 6b 65 20 |r switch|es take |
|00002150| 61 72 67 75 6d 65 6e 74 | 73 2e 20 20 2a 2f 0d 0d |argument|s. */..|
|00002160| 23 69 66 6e 64 65 66 20 | 57 4f 52 44 5f 53 57 49 |#ifndef |WORD_SWI|
|00002170| 54 43 48 5f 54 41 4b 45 | 53 5f 41 52 47 0d 23 64 |TCH_TAKE|S_ARG.#d|
|00002180| 65 66 69 6e 65 20 57 4f | 52 44 5f 53 57 49 54 43 |efine WO|RD_SWITC|
|00002190| 48 5f 54 41 4b 45 53 5f | 41 52 47 28 53 54 52 29 |H_TAKES_|ARG(STR)|
|000021a0| 20 28 21 73 74 72 63 6d | 70 20 28 53 54 52 2c 20 | (!strcm|p (STR, |
|000021b0| 22 54 64 61 74 61 22 29 | 29 0d 23 65 6e 64 69 66 |"Tdata")|).#endif|
|000021c0| 0d 0d 2f 2a 20 54 68 69 | 73 20 73 74 72 75 63 74 |../* Thi|s struct|
|000021d0| 75 72 65 20 73 61 79 73 | 20 68 6f 77 20 74 6f 20 |ure says| how to |
|000021e0| 72 75 6e 20 6f 6e 65 20 | 63 6f 6d 70 69 6c 65 72 |run one |compiler|
|000021f0| 2c 20 61 6e 64 20 77 68 | 65 6e 20 74 6f 20 64 6f |, and wh|en to do|
|00002200| 20 73 6f 2e 20 20 2a 2f | 0d 0d 73 74 72 75 63 74 | so. */|..struct|
|00002210| 20 63 6f 6d 70 69 6c 65 | 72 0d 7b 0d 20 20 63 68 | compile|r.{. ch|
|00002220| 61 72 20 2a 73 75 66 66 | 69 78 3b 09 09 09 2f 2a |ar *suff|ix;.../*|
|00002230| 20 55 73 65 20 74 68 69 | 73 20 63 6f 6d 70 69 6c | Use thi|s compil|
|00002240| 65 72 20 66 6f 72 20 69 | 6e 70 75 74 20 66 69 6c |er for i|nput fil|
|00002250| 65 73 0d 09 09 09 09 20 | 20 20 77 68 6f 73 65 20 |es..... | whose |
|00002260| 6e 61 6d 65 73 20 65 6e | 64 20 69 6e 20 74 68 69 |names en|d in thi|
|00002270| 73 20 73 75 66 66 69 78 | 2e 20 20 2a 2f 0d 20 20 |s suffix|. */. |
|00002280| 63 68 61 72 20 2a 73 70 | 65 63 3b 09 09 09 2f 2a |char *sp|ec;.../*|
|00002290| 20 54 6f 20 75 73 65 20 | 74 68 69 73 20 63 6f 6d | To use |this com|
|000022a0| 70 69 6c 65 72 2c 20 70 | 61 73 73 20 74 68 69 73 |piler, p|ass this|
|000022b0| 20 73 70 65 63 0d 09 09 | 09 09 20 20 20 74 6f 20 | spec...|.. to |
|000022c0| 64 6f 5f 73 70 65 63 2e | 20 20 2a 2f 0d 7d 3b 0d |do_spec.| */.};.|
|000022d0| 0d 2f 2a 20 48 65 72 65 | 20 61 72 65 20 74 68 65 |./* Here| are the|
|000022e0| 20 73 70 65 63 73 20 66 | 6f 72 20 63 6f 6d 70 69 | specs f|or compi|
|000022f0| 6c 69 6e 67 20 66 69 6c | 65 73 20 77 69 74 68 20 |ling fil|es with |
|00002300| 76 61 72 69 6f 75 73 20 | 6b 6e 6f 77 6e 20 73 75 |various |known su|
|00002310| 66 66 69 78 65 73 2e 0d | 20 20 20 41 20 66 69 6c |ffixes..| A fil|
|00002320| 65 20 74 68 61 74 20 64 | 6f 65 73 20 6e 6f 74 20 |e that d|oes not |
|00002330| 65 6e 64 20 69 6e 20 61 | 6e 79 20 6f 66 20 74 68 |end in a|ny of th|
|00002340| 65 73 65 20 73 75 66 66 | 69 78 65 73 20 77 69 6c |ese suff|ixes wil|
|00002350| 6c 20 62 65 20 70 61 73 | 73 65 64 0d 20 20 20 75 |l be pas|sed. u|
|00002360| 6e 63 68 61 6e 67 65 64 | 20 74 6f 20 74 68 65 20 |nchanged| to the |
|00002370| 6c 6f 61 64 65 72 20 61 | 6e 64 20 6e 6f 74 68 69 |loader a|nd nothi|
|00002380| 6e 67 20 65 6c 73 65 20 | 77 69 6c 6c 20 62 65 20 |ng else |will be |
|00002390| 64 6f 6e 65 20 74 6f 20 | 69 74 2e 20 20 2a 2f 0d |done to |it. */.|
|000023a0| 0d 73 74 72 75 63 74 20 | 63 6f 6d 70 69 6c 65 72 |.struct |compiler|
|000023b0| 20 63 6f 6d 70 69 6c 65 | 72 73 5b 5d 20 3d 0d 7b | compile|rs[] =.{|
|000023c0| 0d 20 20 7b 22 2e 63 22 | 2c 0d 20 20 20 22 63 70 |. {".c"|,. "cp|
|000023d0| 70 20 25 7b 6e 6f 73 74 | 64 69 6e 63 7d 20 25 7b |p %{nost|dinc} %{|
|000023e0| 43 7d 20 25 7b 76 7d 20 | 25 7b 44 2a 7d 20 25 7b |C} %{v} |%{D*} %{|
|000023f0| 55 2a 7d 20 25 7b 49 2a | 7d 20 25 7b 4d 2a 7d 20 |U*} %{I*|} %{M*} |
|00002400| 25 7b 69 2a 7d 20 25 7b | 74 72 69 67 72 61 70 68 |%{i*} %{|trigraph|
|00002410| 73 7d 20 2d 75 6e 64 65 | 66 20 5c 0d 20 20 20 20 |s} -unde|f \. |
|00002420| 20 20 20 20 2d 44 5f 5f | 47 4e 55 43 5f 5f 20 25 | -D__|GNUC__ %|
|00002430| 7b 61 6e 73 69 3a 2d 74 | 72 69 67 72 61 70 68 73 |{ansi:-t|rigraphs|
|00002440| 20 2d 24 20 2d 44 5f 5f | 53 54 52 49 43 54 5f 41 | -$ -D__|STRICT_A|
|00002450| 4e 53 49 5f 5f 7d 20 25 | 7b 21 61 6e 73 69 3a 25 |NSI__} %|{!ansi:%|
|00002460| 70 7d 20 25 50 5c 0d 20 | 20 20 20 20 20 20 20 25 |p} %P\. | %|
|00002470| 63 20 25 7b 4f 3a 2d 44 | 5f 5f 4f 50 54 49 4d 49 |c %{O:-D|__OPTIMI|
|00002480| 5a 45 5f 5f 7d 20 25 7b | 74 72 61 64 69 74 69 6f |ZE__} %{|traditio|
|00002490| 6e 61 6c 7d 20 25 7b 70 | 65 64 61 6e 74 69 63 7d |nal} %{p|edantic}|
|000024a0| 5c 0d 09 25 7b 57 63 6f | 6d 6d 65 6e 74 2a 7d 20 |\..%{Wco|mment*} |
|000024b0| 25 7b 57 74 72 69 67 72 | 61 70 68 73 7d 20 25 7b |%{Wtrigr|aphs} %{|
|000024c0| 57 61 6c 6c 7d 20 25 43 | 5c 0d 20 20 20 20 20 20 |Wall} %C|\. |
|000024d0| 20 20 25 69 20 25 7b 21 | 4d 2a 3a 25 7b 21 45 3a | %i %{!|M*:%{!E:|
|000024e0| 25 7b 21 70 69 70 65 3a | 25 67 2e 63 70 70 7d 7d |%{!pipe:|%g.cpp}}|
|000024f0| 7d 25 7b 45 3a 25 7b 6f | 2a 7d 7d 25 7b 4d 2a 3a |}%{E:%{o|*}}%{M*:|
|00002500| 25 7b 6f 2a 7d 7d 20 7c | 5c 6e 5c 0d 20 20 20 20 |%{o*}} ||\n\. |
|00002510| 25 7b 21 4d 2a 3a 25 7b | 21 45 3a 63 63 31 20 25 |%{!M*:%{|!E:cc1 %|
|00002520| 7b 21 70 69 70 65 3a 25 | 67 2e 63 70 70 7d 20 25 |{!pipe:%|g.cpp} %|
|00002530| 31 20 5c 0d 09 09 20 20 | 20 25 7b 21 51 3a 2d 71 |1 \... | %{!Q:-q|
|00002540| 75 69 65 74 7d 20 2d 64 | 75 6d 70 62 61 73 65 20 |uiet} -d|umpbase |
|00002550| 25 69 20 25 7b 59 2a 7d | 20 25 7b 64 2a 7d 20 25 |%i %{Y*}| %{d*} %|
|00002560| 7b 6d 2a 7d 20 25 7b 66 | 2a 7d 20 25 7b 61 7d 5c |{m*} %{f|*} %{a}\|
|00002570| 0d 09 09 20 20 20 25 7b | 67 7d 20 25 7b 4f 7d 20 |... %{|g} %{O} |
|00002580| 25 7b 57 2a 7d 20 25 7b | 77 7d 20 25 7b 70 65 64 |%{W*} %{|w} %{ped|
|00002590| 61 6e 74 69 63 7d 20 25 | 7b 61 6e 73 69 7d 20 25 |antic} %|{ansi} %|
|000025a0| 7b 74 72 61 64 69 74 69 | 6f 6e 61 6c 7d 5c 0d 09 |{traditi|onal}\..|
|000025b0| 09 20 20 20 25 7b 76 3a | 2d 76 65 72 73 69 6f 6e |. %{v:|-version|
|000025c0| 7d 20 25 7b 67 67 3a 2d | 73 79 6d 6f 75 74 20 25 |} %{gg:-|symout %|
|000025d0| 67 2e 73 79 6d 7d 20 25 | 7b 70 67 3a 2d 70 7d 20 |g.sym} %|{pg:-p} |
|000025e0| 25 7b 70 7d 5c 0d 09 09 | 20 20 20 25 7b 70 67 3a |%{p}\...| %{pg:|
|000025f0| 25 7b 66 6f 6d 69 74 2d | 66 72 61 6d 65 2d 70 6f |%{fomit-|frame-po|
|00002600| 69 6e 74 65 72 3a 25 65 | 2d 70 67 20 61 6e 64 20 |inter:%e|-pg and |
|00002610| 2d 66 6f 6d 69 74 2d 66 | 72 61 6d 65 2d 70 6f 69 |-fomit-f|rame-poi|
|00002620| 6e 74 65 72 20 61 72 65 | 20 69 6e 63 6f 6d 70 61 |nter are| incompa|
|00002630| 74 69 62 6c 65 7d 7d 5c | 0d 09 09 20 20 20 25 7b |tible}}\|... %{|
|00002640| 53 3a 25 7b 6f 2a 7d 25 | 7b 21 6f 2a 3a 2d 6f 20 |S:%{o*}%|{!o*:-o |
|00002650| 25 62 2e 73 7d 7d 25 7b | 21 53 3a 2d 6f 20 25 7b |%b.s}}%{|!S:-o %{|
|00002660| 7c 21 70 69 70 65 3a 25 | 67 2e 73 7d 7d 20 7c 5c ||!pipe:%|g.s}} |\|
|00002670| 6e 5c 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |n\. | |
|00002680| 20 25 7b 21 53 3a 61 73 | 20 25 7b 52 7d 20 25 7b | %{!S:as| %{R} %{|
|00002690| 6a 7d 20 25 7b 4a 7d 20 | 25 7b 68 7d 20 25 7b 64 |j} %{J} |%{h} %{d|
|000026a0| 32 7d 20 25 61 20 25 7b | 67 67 3a 2d 47 20 25 67 |2} %a %{|gg:-G %g|
|000026b0| 2e 73 79 6d 7d 5c 0d 09 | 09 20 20 20 20 20 20 25 |.sym}\..|. %|
|000026c0| 7b 63 3a 25 7b 6f 2a 7d | 25 7b 21 6f 2a 3a 2d 6f |{c:%{o*}|%{!o*:-o|
|000026d0| 20 25 77 25 62 2e 6f 7d | 7d 25 7b 21 63 3a 2d 6f | %w%b.o}|}%{!c:-o|
|000026e0| 20 25 64 25 77 25 62 2e | 6f 7d 5c 0d 20 20 20 20 | %d%w%b.|o}\. |
|000026f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002700| 20 20 25 7b 21 70 69 70 | 65 3a 25 67 2e 73 7d 5c | %{!pip|e:%g.s}\|
|00002710| 6e 20 7d 7d 7d 22 7d 2c | 0d 20 20 7b 22 2e 63 63 |n }}}"},|. {".cc|
|00002720| 22 2c 0d 20 20 20 22 63 | 70 70 20 2d 2b 20 25 7b |",. "c|pp -+ %{|
|00002730| 6e 6f 73 74 64 69 6e 63 | 7d 20 25 7b 43 7d 20 25 |nostdinc|} %{C} %|
|00002740| 7b 76 7d 20 25 7b 44 2a | 7d 20 25 7b 55 2a 7d 20 |{v} %{D*|} %{U*} |
|00002750| 25 7b 49 2a 7d 20 25 7b | 4d 2a 7d 20 25 7b 69 2a |%{I*} %{|M*} %{i*|
|00002760| 7d 20 5c 0d 20 20 20 20 | 20 20 20 20 2d 75 6e 64 |} \. | -und|
|00002770| 65 66 20 2d 44 5f 5f 47 | 4e 55 43 5f 5f 20 2d 44 |ef -D__G|NUC__ -D|
|00002780| 5f 5f 47 4e 55 47 5f 5f | 20 25 70 20 25 50 5c 0d |__GNUG__| %p %P\.|
|00002790| 20 20 20 20 20 20 20 20 | 25 63 20 25 7b 4f 3a 2d | |%c %{O:-|
|000027a0| 44 5f 5f 4f 50 54 49 4d | 49 5a 45 5f 5f 7d 20 25 |D__OPTIM|IZE__} %|
|000027b0| 7b 74 72 61 64 69 74 69 | 6f 6e 61 6c 7d 20 25 7b |{traditi|onal} %{|
|000027c0| 70 65 64 61 6e 74 69 63 | 7d 5c 0d 09 25 7b 57 63 |pedantic|}\..%{Wc|
|000027d0| 6f 6d 6d 65 6e 74 2a 7d | 20 25 7b 57 74 72 69 67 |omment*}| %{Wtrig|
|000027e0| 72 61 70 68 73 7d 20 25 | 7b 57 61 6c 6c 7d 20 25 |raphs} %|{Wall} %|
|000027f0| 43 5c 0d 20 20 20 20 20 | 20 20 20 25 69 20 25 7b |C\. | %i %{|
|00002800| 21 4d 2a 3a 25 7b 21 45 | 3a 25 7b 21 70 69 70 65 |!M*:%{!E|:%{!pipe|
|00002810| 3a 25 67 2e 63 70 70 7d | 7d 7d 25 7b 45 3a 25 7b |:%g.cpp}|}}%{E:%{|
|00002820| 6f 2a 7d 7d 25 7b 4d 2a | 3a 25 7b 6f 2a 7d 7d 20 |o*}}%{M*|:%{o*}} |
|00002830| 7c 5c 6e 5c 0d 20 20 20 | 20 25 7b 21 4d 2a 3a 25 ||\n\. | %{!M*:%|
|00002840| 7b 21 45 3a 63 63 31 70 | 6c 75 73 20 25 7b 21 70 |{!E:cc1p|lus %{!p|
|00002850| 69 70 65 3a 25 67 2e 63 | 70 70 7d 20 25 31 5c 0d |ipe:%g.c|pp} %1\.|
|00002860| 09 09 20 20 20 25 7b 21 | 51 3a 2d 71 75 69 65 74 |.. %{!|Q:-quiet|
|00002870| 7d 20 2d 64 75 6d 70 62 | 61 73 65 20 25 69 20 25 |} -dumpb|ase %i %|
|00002880| 7b 59 2a 7d 20 25 7b 64 | 2a 7d 20 25 7b 6d 2a 7d |{Y*} %{d|*} %{m*}|
|00002890| 20 25 7b 66 2a 7d 20 25 | 7b 61 7d 5c 0d 09 09 20 | %{f*} %|{a}\... |
|000028a0| 20 20 25 7b 67 7d 20 25 | 7b 4f 7d 20 25 7b 57 2a | %{g} %|{O} %{W*|
|000028b0| 7d 20 25 7b 77 7d 20 25 | 7b 70 65 64 61 6e 74 69 |} %{w} %|{pedanti|
|000028c0| 63 7d 20 25 7b 74 72 61 | 64 69 74 69 6f 6e 61 6c |c} %{tra|ditional|
|000028d0| 7d 5c 0d 09 09 20 20 20 | 25 7b 76 3a 2d 76 65 72 |}\... |%{v:-ver|
|000028e0| 73 69 6f 6e 7d 20 25 7b | 67 67 3a 2d 73 79 6d 6f |sion} %{|gg:-symo|
|000028f0| 75 74 20 25 67 2e 73 79 | 6d 7d 20 25 7b 70 67 3a |ut %g.sy|m} %{pg:|
|00002900| 2d 70 7d 20 25 7b 70 7d | 5c 0d 09 09 20 20 20 25 |-p} %{p}|\... %|
|00002910| 7b 70 67 3a 25 7b 66 6f | 6d 69 74 2d 66 72 61 6d |{pg:%{fo|mit-fram|
|00002920| 65 2d 70 6f 69 6e 74 65 | 72 3a 25 65 2d 70 67 20 |e-pointe|r:%e-pg |
|00002930| 61 6e 64 20 2d 66 6f 6d | 69 74 2d 66 72 61 6d 65 |and -fom|it-frame|
|00002940| 2d 70 6f 69 6e 74 65 72 | 20 61 72 65 20 69 6e 63 |-pointer| are inc|
|00002950| 6f 6d 70 61 74 69 62 6c | 65 7d 7d 5c 0d 09 09 20 |ompatibl|e}}\... |
|00002960| 20 20 25 7b 53 3a 25 7b | 6f 2a 7d 25 7b 21 6f 2a | %{S:%{|o*}%{!o*|
|00002970| 3a 2d 6f 20 25 62 2e 73 | 7d 7d 25 7b 21 53 3a 2d |:-o %b.s|}}%{!S:-|
|00002980| 6f 20 25 7b 7c 21 70 69 | 70 65 3a 25 67 2e 73 7d |o %{|!pi|pe:%g.s}|
|00002990| 7d 20 7c 5c 6e 5c 0d 20 | 20 20 20 20 20 20 20 20 |} |\n\. | |
|000029a0| 20 20 20 20 20 25 7b 21 | 53 3a 61 73 20 25 7b 52 | %{!|S:as %{R|
|000029b0| 7d 20 25 7b 6a 7d 20 25 | 7b 4a 7d 20 25 7b 68 7d |} %{j} %|{J} %{h}|
|000029c0| 20 25 7b 64 32 7d 20 25 | 61 20 25 7b 67 67 3a 2d | %{d2} %|a %{gg:-|
|000029d0| 47 20 25 67 2e 73 79 6d | 7d 5c 0d 09 09 20 20 20 |G %g.sym|}\... |
|000029e0| 20 20 20 25 7b 63 3a 25 | 7b 6f 2a 7d 25 7b 21 6f | %{c:%|{o*}%{!o|
|000029f0| 2a 3a 2d 6f 20 25 77 25 | 62 2e 6f 7d 7d 25 7b 21 |*:-o %w%|b.o}}%{!|
|00002a00| 63 3a 2d 6f 20 25 64 25 | 77 25 62 2e 6f 7d 5c 0d |c:-o %d%|w%b.o}\.|
|00002a10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002a20| 20 20 20 20 20 20 25 7b | 21 70 69 70 65 3a 25 67 | %{|!pipe:%g|
|00002a30| 2e 73 7d 5c 6e 20 7d 7d | 7d 22 7d 2c 0d 20 20 7b |.s}\n }}|}"},. {|
|00002a40| 22 2e 69 22 2c 0d 20 20 | 20 22 63 63 31 20 25 69 |".i",. | "cc1 %i|
|00002a50| 20 25 31 20 25 7b 21 51 | 3a 2d 71 75 69 65 74 7d | %1 %{!Q|:-quiet}|
|00002a60| 20 25 7b 59 2a 7d 20 25 | 7b 64 2a 7d 20 25 7b 6d | %{Y*} %|{d*} %{m|
|00002a70| 2a 7d 20 25 7b 66 2a 7d | 20 25 7b 61 7d 5c 0d 09 |*} %{f*}| %{a}\..|
|00002a80| 25 7b 67 7d 20 25 7b 4f | 7d 20 25 7b 57 2a 7d 20 |%{g} %{O|} %{W*} |
|00002a90| 25 7b 77 7d 20 25 7b 70 | 65 64 61 6e 74 69 63 7d |%{w} %{p|edantic}|
|00002aa0| 20 25 7b 61 6e 73 69 7d | 20 25 7b 74 72 61 64 69 | %{ansi}| %{tradi|
|00002ab0| 74 69 6f 6e 61 6c 7d 5c | 0d 09 25 7b 76 3a 2d 76 |tional}\|..%{v:-v|
|00002ac0| 65 72 73 69 6f 6e 7d 20 | 25 7b 67 67 3a 2d 73 79 |ersion} |%{gg:-sy|
|00002ad0| 6d 6f 75 74 20 25 67 2e | 73 79 6d 7d 20 25 7b 70 |mout %g.|sym} %{p|
|00002ae0| 67 3a 2d 70 7d 20 25 7b | 70 7d 5c 0d 09 25 7b 53 |g:-p} %{|p}\..%{S|
|00002af0| 3a 25 7b 6f 2a 7d 25 7b | 21 6f 2a 3a 2d 6f 20 25 |:%{o*}%{|!o*:-o %|
|00002b00| 62 2e 73 7d 7d 25 7b 21 | 53 3a 2d 6f 20 25 7b 7c |b.s}}%{!|S:-o %{||
|00002b10| 21 70 69 70 65 3a 25 67 | 2e 73 7d 7d 20 7c 5c 6e |!pipe:%g|.s}} |\n|
|00002b20| 5c 0d 20 20 20 20 25 7b | 21 53 3a 61 73 20 25 7b |\. %{|!S:as %{|
|00002b30| 52 7d 20 25 7b 6a 7d 20 | 25 7b 4a 7d 20 25 7b 68 |R} %{j} |%{J} %{h|
|00002b40| 7d 20 25 7b 64 32 7d 20 | 25 61 20 25 7b 67 67 3a |} %{d2} |%a %{gg:|
|00002b50| 2d 47 20 25 67 2e 73 79 | 6d 7d 5c 0d 20 20 20 20 |-G %g.sy|m}\. |
|00002b60| 20 20 20 20 20 20 20 20 | 25 7b 63 3a 25 7b 6f 2a | |%{c:%{o*|
|00002b70| 7d 25 7b 21 6f 2a 3a 2d | 6f 20 25 77 25 62 2e 6f |}%{!o*:-|o %w%b.o|
|00002b80| 7d 7d 25 7b 21 63 3a 2d | 6f 20 25 64 25 77 25 62 |}}%{!c:-|o %d%w%b|
|00002b90| 2e 6f 7d 20 25 7b 21 70 | 69 70 65 3a 25 67 2e 73 |.o} %{!p|ipe:%g.s|
|00002ba0| 7d 5c 6e 20 7d 22 7d 2c | 0d 20 20 7b 22 2e 73 22 |}\n }"},|. {".s"|
|00002bb0| 2c 0d 20 20 20 22 25 7b | 21 53 3a 61 73 20 25 7b |,. "%{|!S:as %{|
|00002bc0| 52 7d 20 25 7b 6a 7d 20 | 25 7b 4a 7d 20 25 7b 68 |R} %{j} |%{J} %{h|
|00002bd0| 7d 20 25 7b 64 32 7d 20 | 25 61 20 5c 0d 20 20 20 |} %{d2} |%a \. |
|00002be0| 20 20 20 20 20 20 20 20 | 20 25 7b 63 3a 25 7b 6f | | %{c:%{o|
|00002bf0| 2a 7d 25 7b 21 6f 2a 3a | 2d 6f 20 25 77 25 62 2e |*}%{!o*:|-o %w%b.|
|00002c00| 6f 7d 7d 25 7b 21 63 3a | 2d 6f 20 25 64 25 77 25 |o}}%{!c:|-o %d%w%|
|00002c10| 62 2e 6f 7d 20 25 69 5c | 6e 20 7d 22 7d 2c 0d 20 |b.o} %i\|n }"},. |
|00002c20| 20 7b 22 2e 53 22 2c 0d | 20 20 20 22 63 70 70 20 | {".S",.| "cpp |
|00002c30| 25 7b 6e 6f 73 74 64 69 | 6e 63 7d 20 25 7b 43 7d |%{nostdi|nc} %{C}|
|00002c40| 20 25 7b 76 7d 20 25 7b | 44 2a 7d 20 25 7b 55 2a | %{v} %{|D*} %{U*|
|00002c50| 7d 20 25 7b 49 2a 7d 20 | 25 7b 4d 2a 7d 20 25 7b |} %{I*} |%{M*} %{|
|00002c60| 74 72 69 67 72 61 70 68 | 73 7d 20 5c 0d 20 20 20 |trigraph|s} \. |
|00002c70| 20 20 20 20 20 2d 75 6e | 64 65 66 20 2d 44 5f 5f | -un|def -D__|
|00002c80| 47 4e 55 43 5f 5f 20 2d | 24 20 25 70 20 25 50 5c |GNUC__ -|$ %p %P\|
|00002c90| 0d 20 20 20 20 20 20 20 | 20 25 63 20 25 7b 4f 3a |. | %c %{O:|
|00002ca0| 2d 44 5f 5f 4f 50 54 49 | 4d 49 5a 45 5f 5f 7d 20 |-D__OPTI|MIZE__} |
|00002cb0| 25 7b 74 72 61 64 69 74 | 69 6f 6e 61 6c 7d 20 25 |%{tradit|ional} %|
|00002cc0| 7b 70 65 64 61 6e 74 69 | 63 7d 5c 0d 09 25 7b 57 |{pedanti|c}\..%{W|
|00002cd0| 63 6f 6d 6d 65 6e 74 2a | 7d 20 25 7b 57 74 72 69 |comment*|} %{Wtri|
|00002ce0| 67 72 61 70 68 73 7d 20 | 25 7b 57 61 6c 6c 7d 20 |graphs} |%{Wall} |
|00002cf0| 25 43 5c 0d 20 20 20 20 | 20 20 20 20 25 69 20 25 |%C\. | %i %|
|00002d00| 7b 21 4d 2a 3a 25 7b 21 | 45 3a 25 7b 21 70 69 70 |{!M*:%{!|E:%{!pip|
|00002d10| 65 3a 25 67 2e 73 7d 7d | 7d 25 7b 45 3a 25 7b 6f |e:%g.s}}|}%{E:%{o|
|00002d20| 2a 7d 7d 25 7b 4d 2a 3a | 25 7b 6f 2a 7d 7d 20 7c |*}}%{M*:|%{o*}} ||
|00002d30| 5c 6e 5c 0d 20 20 20 20 | 25 7b 21 4d 2a 3a 25 7b |\n\. |%{!M*:%{|
|00002d40| 21 45 3a 25 7b 21 53 3a | 61 73 20 25 7b 52 7d 20 |!E:%{!S:|as %{R} |
|00002d50| 25 7b 6a 7d 20 25 7b 4a | 7d 20 25 7b 68 7d 20 25 |%{j} %{J|} %{h} %|
|00002d60| 7b 64 32 7d 20 25 61 20 | 5c 0d 20 20 20 20 20 20 |{d2} %a |\. |
|00002d70| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 25 7b | | %{|
|00002d80| 63 3a 25 7b 6f 2a 7d 25 | 7b 21 6f 2a 3a 2d 6f 20 |c:%{o*}%|{!o*:-o |
|00002d90| 25 77 25 62 2e 6f 7d 7d | 25 7b 21 63 3a 2d 6f 20 |%w%b.o}}|%{!c:-o |
|00002da0| 25 64 25 77 25 62 2e 6f | 7d 5c 0d 09 09 20 20 20 |%d%w%b.o|}\... |
|00002db0| 20 25 7b 21 70 69 70 65 | 3a 25 67 2e 73 7d 5c 6e | %{!pipe|:%g.s}\n|
|00002dc0| 20 7d 7d 7d 22 7d 2c 0d | 20 20 2f 2a 20 4d 61 72 | }}}"},.| /* Mar|
|00002dd0| 6b 20 65 6e 64 20 6f 66 | 20 74 61 62 6c 65 20 2a |k end of| table *|
|00002de0| 2f 0d 20 20 7b 30 2c 20 | 30 7d 0d 7d 3b 0d 0d 2f |/. {0, |0}.};../|
|00002df0| 2a 20 48 65 72 65 20 69 | 73 20 74 68 65 20 73 70 |* Here i|s the sp|
|00002e00| 65 63 20 66 6f 72 20 72 | 75 6e 6e 69 6e 67 20 74 |ec for r|unning t|
|00002e10| 68 65 20 6c 69 6e 6b 65 | 72 2c 20 61 66 74 65 72 |he linke|r, after|
|00002e20| 20 63 6f 6d 70 69 6c 69 | 6e 67 20 61 6c 6c 20 66 | compili|ng all f|
|00002e30| 69 6c 65 73 2e 20 20 2a | 2f 0d 63 68 61 72 20 2a |iles. *|/.char *|
|00002e40| 6c 69 6e 6b 5f 73 70 65 | 63 20 3d 20 22 25 7b 21 |link_spe|c = "%{!|
|00002e50| 63 3a 25 7b 21 4d 2a 3a | 25 7b 21 45 3a 25 7b 21 |c:%{!M*:|%{!E:%{!|
|00002e60| 53 3a 6c 64 20 25 7b 6f | 2a 7d 20 25 6c 5c 0d 20 |S:ld %{o|*} %l\. |
|00002e70| 25 7b 41 7d 20 25 7b 64 | 7d 20 25 7b 65 2a 7d 20 |%{A} %{d|} %{e*} |
|00002e80| 25 7b 4e 7d 20 25 7b 6e | 7d 20 25 7b 72 7d 20 25 |%{N} %{n|} %{r} %|
|00002e90| 7b 73 7d 20 25 7b 53 7d | 20 25 7b 54 2a 7d 20 25 |{s} %{S}| %{T*} %|
|00002ea0| 7b 74 7d 20 25 7b 75 2a | 7d 20 25 7b 58 7d 20 25 |{t} %{u*|} %{X} %|
|00002eb0| 7b 78 7d 20 25 7b 7a 7d | 5c 0d 20 25 7b 79 2a 7d |{x} %{z}|\. %{y*}|
|00002ec0| 20 25 7b 21 41 3a 25 7b | 21 6e 6f 73 74 64 6c 69 | %{!A:%{|!nostdli|
|00002ed0| 62 3a 25 53 7d 7d 20 5c | 0d 20 25 7b 4c 2a 7d 20 |b:%S}} \|. %{L*} |
|00002ee0| 25 6f 20 25 7b 21 6e 6f | 73 74 64 6c 69 62 3a 67 |%o %{!no|stdlib:g|
|00002ef0| 6e 75 6c 69 62 25 73 20 | 25 7b 67 3a 2d 6c 67 7d |nulib%s |%{g:-lg}|
|00002f00| 20 25 4c 20 67 6e 75 6c | 69 62 25 73 7d 5c 6e 20 | %L gnul|ib%s}\n |
|00002f10| 7d 7d 7d 7d 22 3b 0d 0c | 0d 2f 2a 20 41 63 63 75 |}}}}";..|./* Accu|
|00002f20| 6d 75 6c 61 74 65 20 61 | 20 63 6f 6d 6d 61 6e 64 |mulate a| command|
|00002f30| 20 28 70 72 6f 67 72 61 | 6d 20 6e 61 6d 65 20 61 | (progra|m name a|
|00002f40| 6e 64 20 61 72 67 73 29 | 2c 20 61 6e 64 20 72 75 |nd args)|, and ru|
|00002f50| 6e 20 69 74 2e 20 20 2a | 2f 0d 0d 2f 2a 20 56 65 |n it. *|/../* Ve|
|00002f60| 63 74 6f 72 20 6f 66 20 | 70 6f 69 6e 74 65 72 73 |ctor of |pointers|
|00002f70| 20 74 6f 20 61 72 67 75 | 6d 65 6e 74 73 20 69 6e | to argu|ments in|
|00002f80| 20 74 68 65 20 63 75 72 | 72 65 6e 74 20 6c 69 6e | the cur|rent lin|
|00002f90| 65 20 6f 66 20 73 70 65 | 63 69 66 69 63 61 74 69 |e of spe|cificati|
|00002fa0| 6f 6e 73 2e 20 20 2a 2f | 0d 0d 63 68 61 72 20 2a |ons. */|..char *|
|00002fb0| 2a 61 72 67 62 75 66 3b | 0d 0d 2f 2a 20 4e 75 6d |*argbuf;|../* Num|
|00002fc0| 62 65 72 20 6f 66 20 65 | 6c 65 6d 65 6e 74 73 20 |ber of e|lements |
|00002fd0| 61 6c 6c 6f 63 61 74 65 | 64 20 69 6e 20 61 72 67 |allocate|d in arg|
|00002fe0| 62 75 66 2e 20 20 2a 2f | 0d 0d 69 6e 74 20 61 72 |buf. */|..int ar|
|00002ff0| 67 62 75 66 5f 6c 65 6e | 67 74 68 3b 0d 0d 2f 2a |gbuf_len|gth;../*|
|00003000| 20 4e 75 6d 62 65 72 20 | 6f 66 20 65 6c 65 6d 65 | Number |of eleme|
|00003010| 6e 74 73 20 69 6e 20 61 | 72 67 62 75 66 20 63 75 |nts in a|rgbuf cu|
|00003020| 72 72 65 6e 74 6c 79 20 | 69 6e 20 75 73 65 20 28 |rrently |in use (|
|00003030| 63 6f 6e 74 61 69 6e 69 | 6e 67 20 61 72 67 73 29 |containi|ng args)|
|00003040| 2e 20 20 2a 2f 0d 0d 69 | 6e 74 20 61 72 67 62 75 |. */..i|nt argbu|
|00003050| 66 5f 69 6e 64 65 78 3b | 0d 0d 2f 2a 20 4e 75 6d |f_index;|../* Num|
|00003060| 62 65 72 20 6f 66 20 63 | 6f 6d 6d 61 6e 64 73 20 |ber of c|ommands |
|00003070| 65 78 65 63 75 74 65 64 | 20 73 6f 20 66 61 72 2e |executed| so far.|
|00003080| 20 20 2a 2f 0d 0d 69 6e | 74 20 65 78 65 63 75 74 | */..in|t execut|
|00003090| 69 6f 6e 5f 63 6f 75 6e | 74 3b 0d 0d 2f 2a 20 46 |ion_coun|t;../* F|
|000030a0| 6c 61 67 20 69 6e 64 69 | 63 61 74 69 6e 67 20 77 |lag indi|cating w|
|000030b0| 68 65 74 68 65 72 20 77 | 65 20 73 68 6f 75 6c 64 |hether w|e should|
|000030c0| 20 70 72 69 6e 74 20 74 | 68 65 20 63 6f 6d 6d 61 | print t|he comma|
|000030d0| 6e 64 20 61 6e 64 20 61 | 72 67 75 6d 65 6e 74 73 |nd and a|rguments|
|000030e0| 20 2a 2f 0d 0d 75 6e 73 | 69 67 6e 65 64 20 63 68 | */..uns|igned ch|
|000030f0| 61 72 20 76 66 6c 61 67 | 3b 0d 0d 2f 2a 20 4e 61 |ar vflag|;../* Na|
|00003100| 6d 65 20 77 69 74 68 20 | 77 68 69 63 68 20 74 68 |me with |which th|
|00003110| 69 73 20 70 72 6f 67 72 | 61 6d 20 77 61 73 20 69 |is progr|am was i|
|00003120| 6e 76 6f 6b 65 64 2e 20 | 20 2a 2f 0d 0d 63 68 61 |nvoked. | */..cha|
|00003130| 72 20 2a 70 72 6f 67 72 | 61 6d 6e 61 6d 65 3b 0d |r *progr|amname;.|
|00003140| 0d 2f 2a 20 55 73 65 72 | 2d 73 70 65 63 69 66 69 |./* User|-specifi|
|00003150| 65 64 20 2d 42 20 70 72 | 65 66 69 78 20 74 6f 20 |ed -B pr|efix to |
|00003160| 61 74 74 61 63 68 20 74 | 6f 20 63 6f 6d 6d 61 6e |attach t|o comman|
|00003170| 64 20 6e 61 6d 65 73 2c | 0d 20 20 20 6f 72 20 30 |d names,|. or 0|
|00003180| 20 69 66 20 6e 6f 6e 65 | 20 73 70 65 63 69 66 69 | if none| specifi|
|00003190| 65 64 2e 20 20 2a 2f 0d | 0d 63 68 61 72 20 2a 75 |ed. */.|.char *u|
|000031a0| 73 65 72 5f 65 78 65 63 | 5f 70 72 65 66 69 78 20 |ser_exec|_prefix |
|000031b0| 3d 20 30 3b 0d 0d 2f 2a | 20 45 6e 76 69 72 6f 6e |= 0;../*| Environ|
|000031c0| 6d 65 6e 74 2d 73 70 65 | 63 69 66 69 65 64 20 70 |ment-spe|cified p|
|000031d0| 72 65 66 69 78 20 74 6f | 20 61 74 74 61 63 68 20 |refix to| attach |
|000031e0| 74 6f 20 63 6f 6d 6d 61 | 6e 64 20 6e 61 6d 65 73 |to comma|nd names|
|000031f0| 2c 0d 20 20 20 6f 72 20 | 30 20 69 66 20 6e 6f 6e |,. or |0 if non|
|00003200| 65 20 73 70 65 63 69 66 | 69 65 64 2e 20 20 2a 2f |e specif|ied. */|
|00003210| 0d 0d 63 68 61 72 20 2a | 65 6e 76 5f 65 78 65 63 |..char *|env_exec|
|00003220| 5f 70 72 65 66 69 78 20 | 3d 20 30 3b 0d 0d 2f 2a |_prefix |= 0;../*|
|00003230| 20 53 75 66 66 69 78 20 | 74 6f 20 61 74 74 61 63 | Suffix |to attac|
|00003240| 68 20 74 6f 20 64 69 72 | 65 63 74 6f 72 69 65 73 |h to dir|ectories|
|00003250| 20 73 65 61 72 63 68 65 | 64 20 66 6f 72 20 63 6f | searche|d for co|
|00003260| 6d 6d 61 6e 64 73 2e 20 | 20 2a 2f 0d 0d 63 68 61 |mmands. | */..cha|
|00003270| 72 20 2a 6d 61 63 68 69 | 6e 65 5f 73 75 66 66 69 |r *machi|ne_suffi|
|00003280| 78 20 3d 20 30 3b 0d 0d | 2f 2a 20 44 65 66 61 75 |x = 0;..|/* Defau|
|00003290| 6c 74 20 70 72 65 66 69 | 78 65 73 20 74 6f 20 61 |lt prefi|xes to a|
|000032a0| 74 74 61 63 68 20 74 6f | 20 63 6f 6d 6d 61 6e 64 |ttach to| command|
|000032b0| 20 6e 61 6d 65 73 2e 20 | 20 2a 2f 0d 0d 23 69 66 | names. | */..#if|
|000032c0| 6e 64 65 66 20 53 54 41 | 4e 44 41 52 44 5f 45 58 |ndef STA|NDARD_EX|
|000032d0| 45 43 5f 50 52 45 46 49 | 58 0d 23 64 65 66 69 6e |EC_PREFI|X.#defin|
|000032e0| 65 20 53 54 41 4e 44 41 | 52 44 5f 45 58 45 43 5f |e STANDA|RD_EXEC_|
|000032f0| 50 52 45 46 49 58 20 22 | 2f 75 73 72 2f 6c 6f 63 |PREFIX "|/usr/loc|
|00003300| 61 6c 2f 6c 69 62 2f 67 | 63 63 2d 22 0d 23 65 6e |al/lib/g|cc-".#en|
|00003310| 64 69 66 20 2f 2a 20 21 | 64 65 66 69 6e 65 64 20 |dif /* !|defined |
|00003320| 53 54 41 4e 44 41 52 44 | 5f 45 58 45 43 5f 50 52 |STANDARD|_EXEC_PR|
|00003330| 45 46 49 58 20 2a 2f 0d | 0d 63 68 61 72 20 2a 73 |EFIX */.|.char *s|
|00003340| 74 61 6e 64 61 72 64 5f | 65 78 65 63 5f 70 72 65 |tandard_|exec_pre|
|00003350| 66 69 78 20 3d 20 53 54 | 41 4e 44 41 52 44 5f 45 |fix = ST|ANDARD_E|
|00003360| 58 45 43 5f 50 52 45 46 | 49 58 3b 0d 63 68 61 72 |XEC_PREF|IX;.char|
|00003370| 20 2a 73 74 61 6e 64 61 | 72 64 5f 65 78 65 63 5f | *standa|rd_exec_|
|00003380| 70 72 65 66 69 78 5f 31 | 20 3d 20 22 2f 75 73 72 |prefix_1| = "/usr|
|00003390| 2f 6c 69 62 2f 67 63 63 | 2d 22 3b 0d 0d 23 69 66 |/lib/gcc|-";..#if|
|000033a0| 6e 64 65 66 20 53 54 41 | 4e 44 41 52 44 5f 53 54 |ndef STA|NDARD_ST|
|000033b0| 41 52 54 46 49 4c 45 5f | 50 52 45 46 49 58 0d 23 |ARTFILE_|PREFIX.#|
|000033c0| 64 65 66 69 6e 65 20 53 | 54 41 4e 44 41 52 44 5f |define S|TANDARD_|
|000033d0| 53 54 41 52 54 46 49 4c | 45 5f 50 52 45 46 49 58 |STARTFIL|E_PREFIX|
|000033e0| 20 22 2f 75 73 72 2f 6c | 6f 63 61 6c 2f 6c 69 62 | "/usr/l|ocal/lib|
|000033f0| 2f 22 0d 23 65 6e 64 69 | 66 20 2f 2a 20 21 64 65 |/".#endi|f /* !de|
|00003400| 66 69 6e 65 64 20 53 54 | 41 4e 44 41 52 44 5f 53 |fined ST|ANDARD_S|
|00003410| 54 41 52 54 46 49 4c 45 | 5f 50 52 45 46 49 58 20 |TARTFILE|_PREFIX |
|00003420| 2a 2f 0d 0d 63 68 61 72 | 20 2a 73 74 61 6e 64 61 |*/..char| *standa|
|00003430| 72 64 5f 73 74 61 72 74 | 66 69 6c 65 5f 70 72 65 |rd_start|file_pre|
|00003440| 66 69 78 20 3d 20 53 54 | 41 4e 44 41 52 44 5f 53 |fix = ST|ANDARD_S|
|00003450| 54 41 52 54 46 49 4c 45 | 5f 50 52 45 46 49 58 3b |TARTFILE|_PREFIX;|
|00003460| 0d 63 68 61 72 20 2a 73 | 74 61 6e 64 61 72 64 5f |.char *s|tandard_|
|00003470| 73 74 61 72 74 66 69 6c | 65 5f 70 72 65 66 69 78 |startfil|e_prefix|
|00003480| 5f 31 20 3d 20 22 2f 6c | 69 62 2f 22 3b 0d 63 68 |_1 = "/l|ib/";.ch|
|00003490| 61 72 20 2a 73 74 61 6e | 64 61 72 64 5f 73 74 61 |ar *stan|dard_sta|
|000034a0| 72 74 66 69 6c 65 5f 70 | 72 65 66 69 78 5f 32 20 |rtfile_p|refix_2 |
|000034b0| 3d 20 22 2f 75 73 72 2f | 6c 69 62 2f 22 3b 0d 0d |= "/usr/|lib/";..|
|000034c0| 2f 2a 20 43 6c 65 61 72 | 20 6f 75 74 20 74 68 65 |/* Clear| out the|
|000034d0| 20 76 65 63 74 6f 72 20 | 6f 66 20 61 72 67 75 6d | vector |of argum|
|000034e0| 65 6e 74 73 20 28 61 66 | 74 65 72 20 61 20 63 6f |ents (af|ter a co|
|000034f0| 6d 6d 61 6e 64 20 69 73 | 20 65 78 65 63 75 74 65 |mmand is| execute|
|00003500| 64 29 2e 20 20 2a 2f 0d | 0d 76 6f 69 64 0d 63 6c |d). */.|.void.cl|
|00003510| 65 61 72 5f 61 72 67 73 | 20 28 29 0d 7b 0d 20 20 |ear_args| ().{. |
|00003520| 61 72 67 62 75 66 5f 69 | 6e 64 65 78 20 3d 20 30 |argbuf_i|ndex = 0|
|00003530| 3b 0d 7d 0d 0d 2f 2a 20 | 41 64 64 20 6f 6e 65 20 |;.}../* |Add one |
|00003540| 61 72 67 75 6d 65 6e 74 | 20 74 6f 20 74 68 65 20 |argument| to the |
|00003550| 76 65 63 74 6f 72 20 61 | 74 20 74 68 65 20 65 6e |vector a|t the en|
|00003560| 64 2e 0d 20 20 20 54 68 | 69 73 20 69 73 20 64 6f |d.. Th|is is do|
|00003570| 6e 65 20 77 68 65 6e 20 | 61 20 73 70 61 63 65 20 |ne when |a space |
|00003580| 69 73 20 73 65 65 6e 20 | 6f 72 20 61 74 20 74 68 |is seen |or at th|
|00003590| 65 20 65 6e 64 20 6f 66 | 20 74 68 65 20 6c 69 6e |e end of| the lin|
|000035a0| 65 2e 0d 20 20 20 49 66 | 20 44 45 4c 45 54 45 5f |e.. If| DELETE_|
|000035b0| 41 4c 57 41 59 53 20 69 | 73 20 6e 6f 6e 7a 65 72 |ALWAYS i|s nonzer|
|000035c0| 6f 2c 20 74 68 65 20 61 | 72 67 20 69 73 20 61 20 |o, the a|rg is a |
|000035d0| 66 69 6c 65 6e 61 6d 65 | 0d 20 20 20 20 61 6e 64 |filename|. and|
|000035e0| 20 74 68 65 20 66 69 6c | 65 20 73 68 6f 75 6c 64 | the fil|e should|
|000035f0| 20 62 65 20 64 65 6c 65 | 74 65 64 20 65 76 65 6e | be dele|ted even|
|00003600| 74 75 61 6c 6c 79 2e 0d | 20 20 20 49 66 20 44 45 |tually..| If DE|
|00003610| 4c 45 54 45 5f 46 41 49 | 4c 55 52 45 20 69 73 20 |LETE_FAI|LURE is |
|00003620| 6e 6f 6e 7a 65 72 6f 2c | 20 74 68 65 20 61 72 67 |nonzero,| the arg|
|00003630| 20 69 73 20 61 20 66 69 | 6c 65 6e 61 6d 65 0d 20 | is a fi|lename. |
|00003640| 20 20 20 61 6e 64 20 74 | 68 65 20 66 69 6c 65 20 | and t|he file |
|00003650| 73 68 6f 75 6c 64 20 62 | 65 20 64 65 6c 65 74 65 |should b|e delete|
|00003660| 64 20 69 66 20 74 68 69 | 73 20 63 6f 6d 70 69 6c |d if thi|s compil|
|00003670| 61 74 69 6f 6e 20 66 61 | 69 6c 73 2e 20 20 2a 2f |ation fa|ils. */|
|00003680| 0d 0d 76 6f 69 64 0d 73 | 74 6f 72 65 5f 61 72 67 |..void.s|tore_arg|
|00003690| 20 28 61 72 67 2c 20 64 | 65 6c 65 74 65 5f 61 6c | (arg, d|elete_al|
|000036a0| 77 61 79 73 2c 20 64 65 | 6c 65 74 65 5f 66 61 69 |ways, de|lete_fai|
|000036b0| 6c 75 72 65 29 0d 20 20 | 20 20 20 63 68 61 72 20 |lure). | char |
|000036c0| 2a 61 72 67 3b 0d 20 20 | 20 20 20 69 6e 74 20 64 |*arg;. | int d|
|000036d0| 65 6c 65 74 65 5f 61 6c | 77 61 79 73 2c 20 64 65 |elete_al|ways, de|
|000036e0| 6c 65 74 65 5f 66 61 69 | 6c 75 72 65 3b 0d 7b 0d |lete_fai|lure;.{.|
|000036f0| 20 20 69 66 20 28 61 72 | 67 62 75 66 5f 69 6e 64 | if (ar|gbuf_ind|
|00003700| 65 78 20 2b 20 31 20 3d | 3d 20 61 72 67 62 75 66 |ex + 1 =|= argbuf|
|00003710| 5f 6c 65 6e 67 74 68 29 | 0d 20 20 20 20 7b 0d 20 |_length)|. {. |
|00003720| 20 20 20 20 20 61 72 67 | 62 75 66 20 3d 20 28 63 | arg|buf = (c|
|00003730| 68 61 72 20 2a 2a 29 20 | 72 65 61 6c 6c 6f 63 20 |har **) |realloc |
|00003740| 28 61 72 67 62 75 66 2c | 20 28 61 72 67 62 75 66 |(argbuf,| (argbuf|
|00003750| 5f 6c 65 6e 67 74 68 20 | 2a 3d 20 32 29 20 2a 20 |_length |*= 2) * |
|00003760| 73 69 7a 65 6f 66 20 28 | 63 68 61 72 20 2a 29 29 |sizeof (|char *))|
|00003770| 3b 0d 20 20 20 20 7d 0d | 0d 20 20 61 72 67 62 75 |;. }.|. argbu|
|00003780| 66 5b 61 72 67 62 75 66 | 5f 69 6e 64 65 78 2b 2b |f[argbuf|_index++|
|00003790| 5d 20 3d 20 61 72 67 3b | 0d 20 20 61 72 67 62 75 |] = arg;|. argbu|
|000037a0| 66 5b 61 72 67 62 75 66 | 5f 69 6e 64 65 78 5d 20 |f[argbuf|_index] |
|000037b0| 3d 20 30 3b 0d 0d 20 20 | 69 66 20 28 64 65 6c 65 |= 0;.. |if (dele|
|000037c0| 74 65 5f 61 6c 77 61 79 | 73 20 7c 7c 20 64 65 6c |te_alway|s || del|
|000037d0| 65 74 65 5f 66 61 69 6c | 75 72 65 29 0d 20 20 20 |ete_fail|ure). |
|000037e0| 20 72 65 63 6f 72 64 5f | 74 65 6d 70 5f 66 69 6c | record_|temp_fil|
|000037f0| 65 20 28 61 72 67 2c 20 | 64 65 6c 65 74 65 5f 61 |e (arg, |delete_a|
|00003800| 6c 77 61 79 73 2c 20 64 | 65 6c 65 74 65 5f 66 61 |lways, d|elete_fa|
|00003810| 69 6c 75 72 65 29 3b 0d | 7d 0d 0c 0d 2f 2a 20 52 |ilure);.|}.../* R|
|00003820| 65 63 6f 72 64 20 74 68 | 65 20 6e 61 6d 65 73 20 |ecord th|e names |
|00003830| 6f 66 20 74 65 6d 70 6f | 72 61 72 79 20 66 69 6c |of tempo|rary fil|
|00003840| 65 73 20 77 65 20 74 65 | 6c 6c 20 63 6f 6d 70 69 |es we te|ll compi|
|00003850| 6c 65 72 73 20 74 6f 20 | 77 72 69 74 65 2c 0d 20 |lers to |write,. |
|00003860| 20 20 61 6e 64 20 64 65 | 6c 65 74 65 20 74 68 65 | and de|lete the|
|00003870| 6d 20 61 74 20 74 68 65 | 20 65 6e 64 20 6f 66 20 |m at the| end of |
|00003880| 74 68 65 20 72 75 6e 2e | 20 20 2a 2f 0d 0d 2f 2a |the run.| */../*|
|00003890| 20 54 68 69 73 20 69 73 | 20 74 68 65 20 63 6f 6d | This is| the com|
|000038a0| 6d 6f 6e 20 70 72 65 66 | 69 78 20 77 65 20 75 73 |mon pref|ix we us|
|000038b0| 65 20 74 6f 20 6d 61 6b | 65 20 74 65 6d 70 20 66 |e to mak|e temp f|
|000038c0| 69 6c 65 20 6e 61 6d 65 | 73 2e 0d 20 20 20 49 74 |ile name|s.. It|
|000038d0| 20 69 73 20 63 68 6f 73 | 65 6e 20 6f 6e 63 65 20 | is chos|en once |
|000038e0| 66 6f 72 20 65 61 63 68 | 20 72 75 6e 20 6f 66 20 |for each| run of |
|000038f0| 74 68 69 73 20 70 72 6f | 67 72 61 6d 2e 0d 20 20 |this pro|gram.. |
|00003900| 20 49 74 20 69 73 20 73 | 75 62 73 74 69 74 75 74 | It is s|ubstitut|
|00003910| 65 64 20 69 6e 74 6f 20 | 61 20 73 70 65 63 20 62 |ed into |a spec b|
|00003920| 79 20 25 67 2e 0d 20 20 | 20 54 68 75 73 2c 20 61 |y %g.. | Thus, a|
|00003930| 6c 6c 20 74 65 6d 70 20 | 66 69 6c 65 20 6e 61 6d |ll temp |file nam|
|00003940| 65 73 20 63 6f 6e 74 61 | 69 6e 20 74 68 69 73 20 |es conta|in this |
|00003950| 70 72 65 66 69 78 2e 0d | 20 20 20 49 6e 20 70 72 |prefix..| In pr|
|00003960| 61 63 74 69 63 65 2c 20 | 61 6c 6c 20 74 65 6d 70 |actice, |all temp|
|00003970| 20 66 69 6c 65 20 6e 61 | 6d 65 73 20 73 74 61 72 | file na|mes star|
|00003980| 74 20 77 69 74 68 20 74 | 68 69 73 20 70 72 65 66 |t with t|his pref|
|00003990| 69 78 2e 0d 0d 20 20 20 | 54 68 69 73 20 70 72 65 |ix... |This pre|
|000039a0| 66 69 78 20 63 6f 6d 65 | 73 20 66 72 6f 6d 20 74 |fix come|s from t|
|000039b0| 68 65 20 65 6e 76 76 61 | 72 20 54 4d 50 44 49 52 |he envva|r TMPDIR|
|000039c0| 20 69 66 20 69 74 20 69 | 73 20 64 65 66 69 6e 65 | if it i|s define|
|000039d0| 64 3b 0d 20 20 20 6f 74 | 68 65 72 77 69 73 65 2c |d;. ot|herwise,|
|000039e0| 20 66 72 6f 6d 20 74 68 | 65 20 50 5f 74 6d 70 64 | from th|e P_tmpd|
|000039f0| 69 72 20 6d 61 63 72 6f | 20 69 66 20 74 68 61 74 |ir macro| if that|
|00003a00| 20 69 73 20 64 65 66 69 | 6e 65 64 3b 0d 20 20 20 | is defi|ned;. |
|00003a10| 6f 74 68 65 72 77 69 73 | 65 2c 20 69 6e 20 2f 75 |otherwis|e, in /u|
|00003a20| 73 72 2f 74 6d 70 20 6f | 72 20 2f 74 6d 70 2e 20 |sr/tmp o|r /tmp. |
|00003a30| 20 2a 2f 0d 0d 63 68 61 | 72 20 2a 74 65 6d 70 5f | */..cha|r *temp_|
|00003a40| 66 69 6c 65 6e 61 6d 65 | 3b 0d 0d 2f 2a 20 4c 65 |filename|;../* Le|
|00003a50| 6e 67 74 68 20 6f 66 20 | 74 68 65 20 70 72 65 66 |ngth of |the pref|
|00003a60| 69 78 2e 20 20 2a 2f 0d | 0d 69 6e 74 20 74 65 6d |ix. */.|.int tem|
|00003a70| 70 5f 66 69 6c 65 6e 61 | 6d 65 5f 6c 65 6e 67 74 |p_filena|me_lengt|
|00003a80| 68 3b 0d 0d 2f 2a 20 44 | 65 66 69 6e 65 20 74 68 |h;../* D|efine th|
|00003a90| 65 20 6c 69 73 74 20 6f | 66 20 74 65 6d 70 6f 72 |e list o|f tempor|
|00003aa0| 61 72 79 20 66 69 6c 65 | 73 20 74 6f 20 64 65 6c |ary file|s to del|
|00003ab0| 65 74 65 2e 20 20 2a 2f | 0d 0d 73 74 72 75 63 74 |ete. */|..struct|
|00003ac0| 20 74 65 6d 70 5f 66 69 | 6c 65 0d 7b 0d 20 20 63 | temp_fi|le.{. c|
|00003ad0| 68 61 72 20 2a 6e 61 6d | 65 3b 0d 20 20 73 74 72 |har *nam|e;. str|
|00003ae0| 75 63 74 20 74 65 6d 70 | 5f 66 69 6c 65 20 2a 6e |uct temp|_file *n|
|00003af0| 65 78 74 3b 0d 7d 3b 0d | 0d 2f 2a 20 51 75 65 75 |ext;.};.|./* Queu|
|00003b00| 65 20 6f 66 20 66 69 6c | 65 73 20 74 6f 20 64 65 |e of fil|es to de|
|00003b10| 6c 65 74 65 20 6f 6e 20 | 73 75 63 63 65 73 73 20 |lete on |success |
|00003b20| 6f 72 20 66 61 69 6c 75 | 72 65 20 6f 66 20 63 6f |or failu|re of co|
|00003b30| 6d 70 69 6c 61 74 69 6f | 6e 2e 20 20 2a 2f 0d 73 |mpilatio|n. */.s|
|00003b40| 74 72 75 63 74 20 74 65 | 6d 70 5f 66 69 6c 65 20 |truct te|mp_file |
|00003b50| 2a 61 6c 77 61 79 73 5f | 64 65 6c 65 74 65 5f 71 |*always_|delete_q|
|00003b60| 75 65 75 65 3b 0d 2f 2a | 20 51 75 65 75 65 20 6f |ueue;./*| Queue o|
|00003b70| 66 20 66 69 6c 65 73 20 | 74 6f 20 64 65 6c 65 74 |f files |to delet|
|00003b80| 65 20 6f 6e 20 66 61 69 | 6c 75 72 65 20 6f 66 20 |e on fai|lure of |
|00003b90| 63 6f 6d 70 69 6c 61 74 | 69 6f 6e 2e 20 20 2a 2f |compilat|ion. */|
|00003ba0| 0d 73 74 72 75 63 74 20 | 74 65 6d 70 5f 66 69 6c |.struct |temp_fil|
|00003bb0| 65 20 2a 66 61 69 6c 75 | 72 65 5f 64 65 6c 65 74 |e *failu|re_delet|
|00003bc0| 65 5f 71 75 65 75 65 3b | 0d 0d 2f 2a 20 52 65 63 |e_queue;|../* Rec|
|00003bd0| 6f 72 64 20 46 49 4c 45 | 4e 41 4d 45 20 61 73 20 |ord FILE|NAME as |
|00003be0| 61 20 66 69 6c 65 20 74 | 6f 20 62 65 20 64 65 6c |a file t|o be del|
|00003bf0| 65 74 65 64 20 61 75 74 | 6f 6d 61 74 69 63 61 6c |eted aut|omatical|
|00003c00| 6c 79 2e 0d 20 20 20 41 | 4c 57 41 59 53 5f 44 45 |ly.. A|LWAYS_DE|
|00003c10| 4c 45 54 45 20 6e 6f 6e | 7a 65 72 6f 20 6d 65 61 |LETE non|zero mea|
|00003c20| 6e 73 20 64 65 6c 65 74 | 65 20 69 74 20 69 66 20 |ns delet|e it if |
|00003c30| 61 6c 6c 20 63 6f 6d 70 | 69 6c 61 74 69 6f 6e 20 |all comp|ilation |
|00003c40| 73 75 63 63 65 65 64 73 | 3b 0d 20 20 20 6f 74 68 |succeeds|;. oth|
|00003c50| 65 72 77 69 73 65 20 64 | 65 6c 65 74 65 20 69 74 |erwise d|elete it|
|00003c60| 20 69 6e 20 61 6e 79 20 | 63 61 73 65 2e 0d 20 20 | in any |case.. |
|00003c70| 20 46 41 49 4c 5f 44 45 | 4c 45 54 45 20 6e 6f 6e | FAIL_DE|LETE non|
|00003c80| 7a 65 72 6f 20 6d 65 61 | 6e 73 20 64 65 6c 65 74 |zero mea|ns delet|
|00003c90| 65 20 69 74 20 69 66 20 | 61 20 63 6f 6d 70 69 6c |e it if |a compil|
|00003ca0| 61 74 69 6f 6e 20 73 74 | 65 70 20 66 61 69 6c 73 |ation st|ep fails|
|00003cb0| 3b 0d 20 20 20 6f 74 68 | 65 72 77 69 73 65 20 64 |;. oth|erwise d|
|00003cc0| 65 6c 65 74 65 20 69 74 | 20 69 6e 20 61 6e 79 20 |elete it| in any |
|00003cd0| 63 61 73 65 2e 20 20 2a | 2f 0d 0d 76 6f 69 64 0d |case. *|/..void.|
|00003ce0| 72 65 63 6f 72 64 5f 74 | 65 6d 70 5f 66 69 6c 65 |record_t|emp_file|
|00003cf0| 20 28 66 69 6c 65 6e 61 | 6d 65 2c 20 61 6c 77 61 | (filena|me, alwa|
|00003d00| 79 73 5f 64 65 6c 65 74 | 65 2c 20 66 61 69 6c 5f |ys_delet|e, fail_|
|00003d10| 64 65 6c 65 74 65 29 0d | 20 20 20 20 20 63 68 61 |delete).| cha|
|00003d20| 72 20 2a 66 69 6c 65 6e | 61 6d 65 3b 0d 20 20 20 |r *filen|ame;. |
|00003d30| 20 20 69 6e 74 20 61 6c | 77 61 79 73 5f 64 65 6c | int al|ways_del|
|00003d40| 65 74 65 3b 0d 20 20 20 | 20 20 69 6e 74 20 66 61 |ete;. | int fa|
|00003d50| 69 6c 5f 64 65 6c 65 74 | 65 3b 0d 7b 0d 20 20 72 |il_delet|e;.{. r|
|00003d60| 65 67 69 73 74 65 72 20 | 63 68 61 72 20 2a 6e 61 |egister |char *na|
|00003d70| 6d 65 3b 0d 20 20 6e 61 | 6d 65 20 3d 20 28 63 68 |me;. na|me = (ch|
|00003d80| 61 72 20 2a 29 20 78 6d | 61 6c 6c 6f 63 20 28 73 |ar *) xm|alloc (s|
|00003d90| 74 72 6c 65 6e 20 28 66 | 69 6c 65 6e 61 6d 65 29 |trlen (f|ilename)|
|00003da0| 20 2b 20 31 29 3b 0d 20 | 20 73 74 72 63 70 79 20 | + 1);. | strcpy |
|00003db0| 28 6e 61 6d 65 2c 20 66 | 69 6c 65 6e 61 6d 65 29 |(name, f|ilename)|
|00003dc0| 3b 0d 0d 20 20 69 66 20 | 28 61 6c 77 61 79 73 5f |;.. if |(always_|
|00003dd0| 64 65 6c 65 74 65 29 0d | 20 20 20 20 7b 0d 20 20 |delete).| {. |
|00003de0| 20 20 20 20 72 65 67 69 | 73 74 65 72 20 73 74 72 | regi|ster str|
|00003df0| 75 63 74 20 74 65 6d 70 | 5f 66 69 6c 65 20 2a 74 |uct temp|_file *t|
|00003e00| 65 6d 70 3b 0d 20 20 20 | 20 20 20 66 6f 72 20 28 |emp;. | for (|
|00003e10| 74 65 6d 70 20 3d 20 61 | 6c 77 61 79 73 5f 64 65 |temp = a|lways_de|
|00003e20| 6c 65 74 65 5f 71 75 65 | 75 65 3b 20 74 65 6d 70 |lete_que|ue; temp|
|00003e30| 3b 20 74 65 6d 70 20 3d | 20 74 65 6d 70 2d 3e 6e |; temp =| temp->n|
|00003e40| 65 78 74 29 0d 09 69 66 | 20 28 21 20 73 74 72 63 |ext)..if| (! strc|
|00003e50| 6d 70 20 28 6e 61 6d 65 | 2c 20 74 65 6d 70 2d 3e |mp (name|, temp->|
|00003e60| 6e 61 6d 65 29 29 0d 09 | 20 20 67 6f 74 6f 20 61 |name))..| goto a|
|00003e70| 6c 72 65 61 64 79 31 3b | 0d 20 20 20 20 20 20 74 |lready1;|. t|
|00003e80| 65 6d 70 20 3d 20 28 73 | 74 72 75 63 74 20 74 65 |emp = (s|truct te|
|00003e90| 6d 70 5f 66 69 6c 65 20 | 2a 29 20 78 6d 61 6c 6c |mp_file |*) xmall|
|00003ea0| 6f 63 20 28 73 69 7a 65 | 6f 66 20 28 73 74 72 75 |oc (size|of (stru|
|00003eb0| 63 74 20 74 65 6d 70 5f | 66 69 6c 65 29 29 3b 0d |ct temp_|file));.|
|00003ec0| 20 20 20 20 20 20 74 65 | 6d 70 2d 3e 6e 65 78 74 | te|mp->next|
|00003ed0| 20 3d 20 61 6c 77 61 79 | 73 5f 64 65 6c 65 74 65 | = alway|s_delete|
|00003ee0| 5f 71 75 65 75 65 3b 0d | 20 20 20 20 20 20 74 65 |_queue;.| te|
|00003ef0| 6d 70 2d 3e 6e 61 6d 65 | 20 3d 20 6e 61 6d 65 3b |mp->name| = name;|
|00003f00| 0d 20 20 20 20 20 20 61 | 6c 77 61 79 73 5f 64 65 |. a|lways_de|
|00003f10| 6c 65 74 65 5f 71 75 65 | 75 65 20 3d 20 74 65 6d |lete_que|ue = tem|
|00003f20| 70 3b 0d 20 20 20 20 61 | 6c 72 65 61 64 79 31 3a |p;. a|lready1:|
|00003f30| 3b 0d 20 20 20 20 7d 0d | 0d 20 20 69 66 20 28 66 |;. }.|. if (f|
|00003f40| 61 69 6c 5f 64 65 6c 65 | 74 65 29 0d 20 20 20 20 |ail_dele|te). |
|00003f50| 7b 0d 20 20 20 20 20 20 | 72 65 67 69 73 74 65 72 |{. |register|
|00003f60| 20 73 74 72 75 63 74 20 | 74 65 6d 70 5f 66 69 6c | struct |temp_fil|
|00003f70| 65 20 2a 74 65 6d 70 3b | 0d 20 20 20 20 20 20 66 |e *temp;|. f|
|00003f80| 6f 72 20 28 74 65 6d 70 | 20 3d 20 66 61 69 6c 75 |or (temp| = failu|
|00003f90| 72 65 5f 64 65 6c 65 74 | 65 5f 71 75 65 75 65 3b |re_delet|e_queue;|
|00003fa0| 20 74 65 6d 70 3b 20 74 | 65 6d 70 20 3d 20 74 65 | temp; t|emp = te|
|00003fb0| 6d 70 2d 3e 6e 65 78 74 | 29 0d 09 69 66 20 28 21 |mp->next|)..if (!|
|00003fc0| 20 73 74 72 63 6d 70 20 | 28 6e 61 6d 65 2c 20 74 | strcmp |(name, t|
|00003fd0| 65 6d 70 2d 3e 6e 61 6d | 65 29 29 0d 09 20 20 67 |emp->nam|e)).. g|
|00003fe0| 6f 74 6f 20 61 6c 72 65 | 61 64 79 32 3b 0d 20 20 |oto alre|ady2;. |
|00003ff0| 20 20 20 20 74 65 6d 70 | 20 3d 20 28 73 74 72 75 | temp| = (stru|
|00004000| 63 74 20 74 65 6d 70 5f | 66 69 6c 65 20 2a 29 20 |ct temp_|file *) |
|00004010| 78 6d 61 6c 6c 6f 63 20 | 28 73 69 7a 65 6f 66 20 |xmalloc |(sizeof |
|00004020| 28 73 74 72 75 63 74 20 | 74 65 6d 70 5f 66 69 6c |(struct |temp_fil|
|00004030| 65 29 29 3b 0d 20 20 20 | 20 20 20 74 65 6d 70 2d |e));. | temp-|
|00004040| 3e 6e 65 78 74 20 3d 20 | 66 61 69 6c 75 72 65 5f |>next = |failure_|
|00004050| 64 65 6c 65 74 65 5f 71 | 75 65 75 65 3b 0d 20 20 |delete_q|ueue;. |
|00004060| 20 20 20 20 74 65 6d 70 | 2d 3e 6e 61 6d 65 20 3d | temp|->name =|
|00004070| 20 6e 61 6d 65 3b 0d 20 | 20 20 20 20 20 66 61 69 | name;. | fai|
|00004080| 6c 75 72 65 5f 64 65 6c | 65 74 65 5f 71 75 65 75 |lure_del|ete_queu|
|00004090| 65 20 3d 20 74 65 6d 70 | 3b 0d 20 20 20 20 61 6c |e = temp|;. al|
|000040a0| 72 65 61 64 79 32 3a 3b | 0d 20 20 20 20 7d 0d 7d |ready2:;|. }.}|
|000040b0| 0d 0d 2f 2a 20 44 65 6c | 65 74 65 20 61 6c 6c 20 |../* Del|ete all |
|000040c0| 74 68 65 20 74 65 6d 70 | 6f 72 61 72 79 20 66 69 |the temp|orary fi|
|000040d0| 6c 65 73 20 77 68 6f 73 | 65 20 6e 61 6d 65 73 20 |les whos|e names |
|000040e0| 77 65 20 70 72 65 76 69 | 6f 75 73 6c 79 20 72 65 |we previ|ously re|
|000040f0| 63 6f 72 64 65 64 2e 20 | 20 2a 2f 0d 0d 76 6f 69 |corded. | */..voi|
|00004100| 64 0d 64 65 6c 65 74 65 | 5f 74 65 6d 70 5f 66 69 |d.delete|_temp_fi|
|00004110| 6c 65 73 20 28 29 0d 7b | 0d 20 20 72 65 67 69 73 |les ().{|. regis|
|00004120| 74 65 72 20 73 74 72 75 | 63 74 20 74 65 6d 70 5f |ter stru|ct temp_|
|00004130| 66 69 6c 65 20 2a 74 65 | 6d 70 3b 0d 0d 20 20 66 |file *te|mp;.. f|
|00004140| 6f 72 20 28 74 65 6d 70 | 20 3d 20 61 6c 77 61 79 |or (temp| = alway|
|00004150| 73 5f 64 65 6c 65 74 65 | 5f 71 75 65 75 65 3b 20 |s_delete|_queue; |
|00004160| 74 65 6d 70 3b 20 74 65 | 6d 70 20 3d 20 74 65 6d |temp; te|mp = tem|
|00004170| 70 2d 3e 6e 65 78 74 29 | 0d 20 20 20 20 7b 0d 23 |p->next)|. {.#|
|00004180| 69 66 64 65 66 20 44 45 | 42 55 47 0d 20 20 20 20 |ifdef DE|BUG. |
|00004190| 20 20 69 6e 74 20 69 3b | 0d 20 20 20 20 20 20 70 | int i;|. p|
|000041a0| 72 69 6e 74 66 20 28 22 | 44 65 6c 65 74 65 20 25 |rintf ("|Delete %|
|000041b0| 73 3f 20 28 79 20 6f 72 | 20 6e 29 20 22 2c 20 74 |s? (y or| n) ", t|
|000041c0| 65 6d 70 2d 3e 6e 61 6d | 65 29 3b 0d 20 20 20 20 |emp->nam|e);. |
|000041d0| 20 20 66 66 6c 75 73 68 | 20 28 73 74 64 6f 75 74 | fflush| (stdout|
|000041e0| 29 3b 0d 20 20 20 20 20 | 20 69 20 3d 20 67 65 74 |);. | i = get|
|000041f0| 63 68 61 72 20 28 29 3b | 0d 20 20 20 20 20 20 69 |char ();|. i|
|00004200| 66 20 28 69 20 21 3d 20 | 27 5c 6e 27 29 0d 09 77 |f (i != |'\n')..w|
|00004210| 68 69 6c 65 20 28 67 65 | 74 63 68 61 72 20 28 29 |hile (ge|tchar ()|
|00004220| 20 21 3d 20 27 5c 6e 27 | 29 20 3b 0d 20 20 20 20 | != '\n'|) ;. |
|00004230| 20 20 69 66 20 28 69 20 | 3d 3d 20 27 79 27 20 7c | if (i |== 'y' ||
|00004240| 7c 20 69 20 3d 3d 20 27 | 59 27 29 0d 23 65 6e 64 || i == '|Y').#end|
|00004250| 69 66 20 2f 2a 20 44 45 | 42 55 47 20 2a 2f 0d 09 |if /* DE|BUG */..|
|00004260| 7b 0d 09 20 20 69 66 20 | 28 75 6e 6c 69 6e 6b 20 |{.. if |(unlink |
|00004270| 28 74 65 6d 70 2d 3e 6e | 61 6d 65 29 20 3c 20 30 |(temp->n|ame) < 0|
|00004280| 29 0d 09 20 20 20 20 69 | 66 20 28 76 66 6c 61 67 |).. i|f (vflag|
|00004290| 29 0d 09 20 20 20 20 20 | 20 70 65 72 72 6f 72 5f |).. | perror_|
|000042a0| 77 69 74 68 5f 6e 61 6d | 65 20 28 74 65 6d 70 2d |with_nam|e (temp-|
|000042b0| 3e 6e 61 6d 65 29 3b 0d | 09 7d 0d 20 20 20 20 7d |>name);.|.}. }|
|000042c0| 0d 0d 20 20 61 6c 77 61 | 79 73 5f 64 65 6c 65 74 |.. alwa|ys_delet|
|000042d0| 65 5f 71 75 65 75 65 20 | 3d 20 30 3b 0d 7d 0d 0d |e_queue |= 0;.}..|
|000042e0| 2f 2a 20 44 65 6c 65 74 | 65 20 61 6c 6c 20 74 68 |/* Delet|e all th|
|000042f0| 65 20 66 69 6c 65 73 20 | 74 6f 20 62 65 20 64 65 |e files |to be de|
|00004300| 6c 65 74 65 64 20 6f 6e | 20 65 72 72 6f 72 2e 20 |leted on| error. |
|00004310| 20 2a 2f 0d 0d 76 6f 69 | 64 0d 64 65 6c 65 74 65 | */..voi|d.delete|
|00004320| 5f 66 61 69 6c 75 72 65 | 5f 71 75 65 75 65 20 28 |_failure|_queue (|
|00004330| 29 0d 7b 0d 20 20 72 65 | 67 69 73 74 65 72 20 73 |).{. re|gister s|
|00004340| 74 72 75 63 74 20 74 65 | 6d 70 5f 66 69 6c 65 20 |truct te|mp_file |
|00004350| 2a 74 65 6d 70 3b 0d 0d | 20 20 66 6f 72 20 28 74 |*temp;..| for (t|
|00004360| 65 6d 70 20 3d 20 66 61 | 69 6c 75 72 65 5f 64 65 |emp = fa|ilure_de|
|00004370| 6c 65 74 65 5f 71 75 65 | 75 65 3b 20 74 65 6d 70 |lete_que|ue; temp|
|00004380| 3b 20 74 65 6d 70 20 3d | 20 74 65 6d 70 2d 3e 6e |; temp =| temp->n|
|00004390| 65 78 74 29 0d 20 20 20 | 20 7b 0d 23 69 66 64 65 |ext). | {.#ifde|
|000043a0| 66 20 44 45 42 55 47 0d | 20 20 20 20 20 20 69 6e |f DEBUG.| in|
|000043b0| 74 20 69 3b 0d 20 20 20 | 20 20 20 70 72 69 6e 74 |t i;. | print|
|000043c0| 66 20 28 22 44 65 6c 65 | 74 65 20 25 73 3f 20 28 |f ("Dele|te %s? (|
|000043d0| 79 20 6f 72 20 6e 29 20 | 22 2c 20 74 65 6d 70 2d |y or n) |", temp-|
|000043e0| 3e 6e 61 6d 65 29 3b 0d | 20 20 20 20 20 20 66 66 |>name);.| ff|
|000043f0| 6c 75 73 68 20 28 73 74 | 64 6f 75 74 29 3b 0d 20 |lush (st|dout);. |
|00004400| 20 20 20 20 20 69 20 3d | 20 67 65 74 63 68 61 72 | i =| getchar|
|00004410| 20 28 29 3b 0d 20 20 20 | 20 20 20 69 66 20 28 69 | ();. | if (i|
|00004420| 20 21 3d 20 27 5c 6e 27 | 29 0d 09 77 68 69 6c 65 | != '\n'|)..while|
|00004430| 20 28 67 65 74 63 68 61 | 72 20 28 29 20 21 3d 20 | (getcha|r () != |
|00004440| 27 5c 6e 27 29 20 3b 0d | 20 20 20 20 20 20 69 66 |'\n') ;.| if|
|00004450| 20 28 69 20 3d 3d 20 27 | 79 27 20 7c 7c 20 69 20 | (i == '|y' || i |
|00004460| 3d 3d 20 27 59 27 29 0d | 23 65 6e 64 69 66 20 2f |== 'Y').|#endif /|
|00004470| 2a 20 44 45 42 55 47 20 | 2a 2f 0d 09 7b 0d 09 20 |* DEBUG |*/..{.. |
|00004480| 20 69 66 20 28 75 6e 6c | 69 6e 6b 20 28 74 65 6d | if (unl|ink (tem|
|00004490| 70 2d 3e 6e 61 6d 65 29 | 20 3c 20 30 29 0d 09 20 |p->name)| < 0).. |
|000044a0| 20 20 20 69 66 20 28 76 | 66 6c 61 67 29 0d 09 20 | if (v|flag).. |
|000044b0| 20 20 20 20 20 70 65 72 | 72 6f 72 5f 77 69 74 68 | per|ror_with|
|000044c0| 5f 6e 61 6d 65 20 28 74 | 65 6d 70 2d 3e 6e 61 6d |_name (t|emp->nam|
|000044d0| 65 29 3b 0d 09 7d 0d 20 | 20 20 20 7d 0d 7d 0d 0d |e);..}. | }.}..|
|000044e0| 76 6f 69 64 0d 63 6c 65 | 61 72 5f 66 61 69 6c 75 |void.cle|ar_failu|
|000044f0| 72 65 5f 71 75 65 75 65 | 20 28 29 0d 7b 0d 20 20 |re_queue| ().{. |
|00004500| 66 61 69 6c 75 72 65 5f | 64 65 6c 65 74 65 5f 71 |failure_|delete_q|
|00004510| 75 65 75 65 20 3d 20 30 | 3b 0d 7d 0d 0d 2f 2a 20 |ueue = 0|;.}../* |
|00004520| 43 6f 6d 70 75 74 65 20 | 61 20 73 74 72 69 6e 67 |Compute |a string|
|00004530| 20 74 6f 20 75 73 65 20 | 61 73 20 74 68 65 20 62 | to use |as the b|
|00004540| 61 73 65 20 6f 66 20 61 | 6c 6c 20 74 65 6d 70 6f |ase of a|ll tempo|
|00004550| 72 61 72 79 20 66 69 6c | 65 20 6e 61 6d 65 73 2e |rary fil|e names.|
|00004560| 0d 20 20 20 49 74 20 69 | 73 20 73 75 62 73 74 69 |. It i|s substi|
|00004570| 74 75 74 65 64 20 66 6f | 72 20 25 67 2e 20 20 2a |tuted fo|r %g. *|
|00004580| 2f 0d 0d 76 6f 69 64 0d | 63 68 6f 6f 73 65 5f 74 |/..void.|choose_t|
|00004590| 65 6d 70 5f 62 61 73 65 | 20 28 29 0d 7b 0d 20 20 |emp_base| ().{. |
|000045a0| 65 78 74 65 72 6e 20 63 | 68 61 72 20 2a 67 65 74 |extern c|har *get|
|000045b0| 65 6e 76 20 28 29 3b 0d | 20 20 63 68 61 72 20 2a |env ();.| char *|
|000045c0| 62 61 73 65 20 3d 20 67 | 65 74 65 6e 76 20 28 22 |base = g|etenv ("|
|000045d0| 54 4d 50 44 49 52 22 29 | 3b 0d 20 20 69 6e 74 20 |TMPDIR")|;. int |
|000045e0| 6c 65 6e 3b 0d 0d 20 20 | 69 66 20 28 62 61 73 65 |len;.. |if (base|
|000045f0| 20 3d 3d 20 28 63 68 61 | 72 20 2a 29 30 29 0d 20 | == (cha|r *)0). |
|00004600| 20 20 20 7b 0d 23 69 66 | 64 65 66 20 50 5f 74 6d | {.#if|def P_tm|
|00004610| 70 64 69 72 0d 20 20 20 | 20 20 20 69 66 20 28 61 |pdir. | if (a|
|00004620| 63 63 65 73 73 20 28 50 | 5f 74 6d 70 64 69 72 2c |ccess (P|_tmpdir,|
|00004630| 20 52 5f 4f 4b 20 7c 20 | 57 5f 4f 4b 29 20 3d 3d | R_OK | |W_OK) ==|
|00004640| 20 30 29 0d 09 62 61 73 | 65 20 3d 20 50 5f 74 6d | 0)..bas|e = P_tm|
|00004650| 70 64 69 72 3b 0d 23 65 | 6e 64 69 66 0d 20 20 20 |pdir;.#e|ndif. |
|00004660| 20 20 20 69 66 20 28 62 | 61 73 65 20 3d 3d 20 28 | if (b|ase == (|
|00004670| 63 68 61 72 20 2a 29 30 | 29 0d 09 7b 0d 09 20 20 |char *)0|)..{.. |
|00004680| 69 66 20 28 61 63 63 65 | 73 73 20 28 22 2f 75 73 |if (acce|ss ("/us|
|00004690| 72 2f 74 6d 70 22 2c 20 | 52 5f 4f 4b 20 7c 20 57 |r/tmp", |R_OK | W|
|000046a0| 5f 4f 4b 29 20 3d 3d 20 | 30 29 0d 09 20 20 20 20 |_OK) == |0).. |
|000046b0| 62 61 73 65 20 3d 20 22 | 2f 75 73 72 2f 74 6d 70 |base = "|/usr/tmp|
|000046c0| 2f 22 3b 0d 09 20 20 65 | 6c 73 65 0d 09 20 20 20 |/";.. e|lse.. |
|000046d0| 20 62 61 73 65 20 3d 20 | 22 2f 74 6d 70 2f 22 3b | base = |"/tmp/";|
|000046e0| 0d 09 7d 0d 20 20 20 20 | 7d 0d 0d 20 20 6c 65 6e |..}. |}.. len|
|000046f0| 20 3d 20 73 74 72 6c 65 | 6e 20 28 62 61 73 65 29 | = strle|n (base)|
|00004700| 3b 0d 20 20 74 65 6d 70 | 5f 66 69 6c 65 6e 61 6d |;. temp|_filenam|
|00004710| 65 20 3d 20 28 63 68 61 | 72 20 2a 29 20 78 6d 61 |e = (cha|r *) xma|
|00004720| 6c 6c 6f 63 20 28 6c 65 | 6e 20 2b 20 73 69 7a 65 |lloc (le|n + size|
|00004730| 6f 66 28 22 2f 63 63 58 | 58 58 58 58 58 22 29 29 |of("/ccX|XXXXX"))|
|00004740| 3b 0d 20 20 73 74 72 63 | 70 79 20 28 74 65 6d 70 |;. strc|py (temp|
|00004750| 5f 66 69 6c 65 6e 61 6d | 65 2c 20 62 61 73 65 29 |_filenam|e, base)|
|00004760| 3b 0d 20 20 69 66 20 28 | 6c 65 6e 20 3e 20 30 20 |;. if (|len > 0 |
|00004770| 26 26 20 74 65 6d 70 5f | 66 69 6c 65 6e 61 6d 65 |&& temp_|filename|
|00004780| 5b 6c 65 6e 2d 31 5d 20 | 21 3d 20 27 2f 27 29 0d |[len-1] |!= '/').|
|00004790| 20 20 20 20 74 65 6d 70 | 5f 66 69 6c 65 6e 61 6d | temp|_filenam|
|000047a0| 65 5b 6c 65 6e 2b 2b 5d | 20 3d 20 27 2f 27 3b 0d |e[len++]| = '/';.|
|000047b0| 20 20 73 74 72 63 70 79 | 20 28 74 65 6d 70 5f 66 | strcpy| (temp_f|
|000047c0| 69 6c 65 6e 61 6d 65 20 | 2b 20 6c 65 6e 2c 20 22 |ilename |+ len, "|
|000047d0| 63 63 58 58 58 58 58 58 | 22 29 3b 0d 0d 20 20 6d |ccXXXXXX|");.. m|
|000047e0| 6b 74 65 6d 70 20 28 74 | 65 6d 70 5f 66 69 6c 65 |ktemp (t|emp_file|
|000047f0| 6e 61 6d 65 29 3b 0d 20 | 20 74 65 6d 70 5f 66 69 |name);. | temp_fi|
|00004800| 6c 65 6e 61 6d 65 5f 6c | 65 6e 67 74 68 20 3d 20 |lename_l|ength = |
|00004810| 73 74 72 6c 65 6e 20 28 | 74 65 6d 70 5f 66 69 6c |strlen (|temp_fil|
|00004820| 65 6e 61 6d 65 29 3b 0d | 7d 0d 0c 0d 2f 2a 20 53 |ename);.|}.../* S|
|00004830| 65 61 72 63 68 20 66 6f | 72 20 61 6e 20 65 78 65 |earch fo|r an exe|
|00004840| 63 75 74 65 20 66 69 6c | 65 20 74 68 72 6f 75 67 |cute fil|e throug|
|00004850| 68 20 6f 75 72 20 73 65 | 61 72 63 68 20 70 61 74 |h our se|arch pat|
|00004860| 68 2e 0d 20 20 20 52 65 | 74 75 72 6e 20 30 20 69 |h.. Re|turn 0 i|
|00004870| 66 20 6e 6f 74 20 66 6f | 75 6e 64 2c 20 6f 74 68 |f not fo|und, oth|
|00004880| 65 72 77 69 73 65 20 72 | 65 74 75 72 6e 20 69 74 |erwise r|eturn it|
|00004890| 73 20 6e 61 6d 65 2c 20 | 61 6c 6c 6f 63 61 74 65 |s name, |allocate|
|000048a0| 64 20 77 69 74 68 20 6d | 61 6c 6c 6f 63 2e 20 20 |d with m|alloc. |
|000048b0| 2a 2f 0d 0d 73 74 61 74 | 69 63 20 63 68 61 72 20 |*/..stat|ic char |
|000048c0| 2a 0d 66 69 6e 64 5f 65 | 78 65 63 5f 66 69 6c 65 |*.find_e|xec_file|
|000048d0| 20 28 70 72 6f 67 29 0d | 20 20 20 20 20 63 68 61 | (prog).| cha|
|000048e0| 72 20 2a 70 72 6f 67 3b | 0d 7b 0d 20 20 69 6e 74 |r *prog;|.{. int|
|000048f0| 20 77 69 6e 20 3d 20 30 | 3b 0d 20 20 63 68 61 72 | win = 0|;. char|
|00004900| 20 2a 74 65 6d 70 3b 0d | 20 20 69 6e 74 20 73 69 | *temp;.| int si|
|00004910| 7a 65 3b 0d 0d 20 20 73 | 69 7a 65 20 3d 20 73 74 |ze;.. s|ize = st|
|00004920| 72 6c 65 6e 20 28 73 74 | 61 6e 64 61 72 64 5f 65 |rlen (st|andard_e|
|00004930| 78 65 63 5f 70 72 65 66 | 69 78 29 3b 0d 20 20 69 |xec_pref|ix);. i|
|00004940| 66 20 28 75 73 65 72 5f | 65 78 65 63 5f 70 72 65 |f (user_|exec_pre|
|00004950| 66 69 78 20 21 3d 20 30 | 20 26 26 20 73 74 72 6c |fix != 0| && strl|
|00004960| 65 6e 20 28 75 73 65 72 | 5f 65 78 65 63 5f 70 72 |en (user|_exec_pr|
|00004970| 65 66 69 78 29 20 3e 20 | 73 69 7a 65 29 0d 20 20 |efix) > |size). |
|00004980| 20 20 73 69 7a 65 20 3d | 20 73 74 72 6c 65 6e 20 | size =| strlen |
|00004990| 28 75 73 65 72 5f 65 78 | 65 63 5f 70 72 65 66 69 |(user_ex|ec_prefi|
|000049a0| 78 29 3b 0d 20 20 69 66 | 20 28 65 6e 76 5f 65 78 |x);. if| (env_ex|
|000049b0| 65 63 5f 70 72 65 66 69 | 78 20 21 3d 20 30 20 26 |ec_prefi|x != 0 &|
|000049c0| 26 20 73 74 72 6c 65 6e | 20 28 65 6e 76 5f 65 78 |& strlen| (env_ex|
|000049d0| 65 63 5f 70 72 65 66 69 | 78 29 20 3e 20 73 69 7a |ec_prefi|x) > siz|
|000049e0| 65 29 0d 20 20 20 20 73 | 69 7a 65 20 3d 20 73 74 |e). s|ize = st|
|000049f0| 72 6c 65 6e 20 28 65 6e | 76 5f 65 78 65 63 5f 70 |rlen (en|v_exec_p|
|00004a00| 72 65 66 69 78 29 3b 0d | 20 20 69 66 20 28 73 74 |refix);.| if (st|
|00004a10| 72 6c 65 6e 20 28 73 74 | 61 6e 64 61 72 64 5f 65 |rlen (st|andard_e|
|00004a20| 78 65 63 5f 70 72 65 66 | 69 78 5f 31 29 20 3e 20 |xec_pref|ix_1) > |
|00004a30| 73 69 7a 65 29 0d 20 20 | 20 20 73 69 7a 65 20 3d |size). | size =|
|00004a40| 20 73 74 72 6c 65 6e 20 | 28 73 74 61 6e 64 61 72 | strlen |(standar|
|00004a50| 64 5f 65 78 65 63 5f 70 | 72 65 66 69 78 5f 31 29 |d_exec_p|refix_1)|
|00004a60| 3b 0d 20 20 73 69 7a 65 | 20 2b 3d 20 73 74 72 6c |;. size| += strl|
|00004a70| 65 6e 20 28 70 72 6f 67 | 29 20 2b 20 31 3b 0d 20 |en (prog|) + 1;. |
|00004a80| 20 69 66 20 28 6d 61 63 | 68 69 6e 65 5f 73 75 66 | if (mac|hine_suf|
|00004a90| 66 69 78 29 0d 20 20 20 | 20 73 69 7a 65 20 2b 3d |fix). | size +=|
|00004aa0| 20 73 74 72 6c 65 6e 20 | 28 6d 61 63 68 69 6e 65 | strlen |(machine|
|00004ab0| 5f 73 75 66 66 69 78 29 | 20 2b 20 31 3b 0d 20 20 |_suffix)| + 1;. |
|00004ac0| 74 65 6d 70 20 3d 20 28 | 63 68 61 72 20 2a 29 20 |temp = (|char *) |
|00004ad0| 78 6d 61 6c 6c 6f 63 20 | 28 73 69 7a 65 29 3b 0d |xmalloc |(size);.|
|00004ae0| 0d 20 20 2f 2a 20 44 65 | 74 65 72 6d 69 6e 65 20 |. /* De|termine |
|00004af0| 74 68 65 20 66 69 6c 65 | 6e 61 6d 65 20 74 6f 20 |the file|name to |
|00004b00| 65 78 65 63 75 74 65 2e | 20 20 2a 2f 0d 0d 20 20 |execute.| */.. |
|00004b10| 69 66 20 28 75 73 65 72 | 5f 65 78 65 63 5f 70 72 |if (user|_exec_pr|
|00004b20| 65 66 69 78 29 0d 20 20 | 20 20 7b 0d 20 20 20 20 |efix). | {. |
|00004b30| 20 20 69 66 20 28 6d 61 | 63 68 69 6e 65 5f 73 75 | if (ma|chine_su|
|00004b40| 66 66 69 78 29 0d 09 7b | 0d 09 20 20 73 74 72 63 |ffix)..{|.. strc|
|00004b50| 70 79 20 28 74 65 6d 70 | 2c 20 75 73 65 72 5f 65 |py (temp|, user_e|
|00004b60| 78 65 63 5f 70 72 65 66 | 69 78 29 3b 0d 09 20 20 |xec_pref|ix);.. |
|00004b70| 73 74 72 63 61 74 20 28 | 74 65 6d 70 2c 20 6d 61 |strcat (|temp, ma|
|00004b80| 63 68 69 6e 65 5f 73 75 | 66 66 69 78 29 3b 0d 09 |chine_su|ffix);..|
|00004b90| 20 20 73 74 72 63 61 74 | 20 28 74 65 6d 70 2c 20 | strcat| (temp, |
|00004ba0| 70 72 6f 67 29 3b 0d 09 | 20 20 77 69 6e 20 3d 20 |prog);..| win = |
|00004bb0| 28 61 63 63 65 73 73 20 | 28 74 65 6d 70 2c 20 58 |(access |(temp, X|
|00004bc0| 5f 4f 4b 29 20 3d 3d 20 | 30 29 3b 0d 09 7d 0d 20 |_OK) == |0);..}. |
|00004bd0| 20 20 20 20 20 69 66 20 | 28 21 77 69 6e 29 0d 09 | if |(!win)..|
|00004be0| 7b 0d 09 20 20 73 74 72 | 63 70 79 20 28 74 65 6d |{.. str|cpy (tem|
|00004bf0| 70 2c 20 75 73 65 72 5f | 65 78 65 63 5f 70 72 65 |p, user_|exec_pre|
|00004c00| 66 69 78 29 3b 0d 09 20 | 20 73 74 72 63 61 74 20 |fix);.. | strcat |
|00004c10| 28 74 65 6d 70 2c 20 70 | 72 6f 67 29 3b 0d 09 20 |(temp, p|rog);.. |
|00004c20| 20 77 69 6e 20 3d 20 28 | 61 63 63 65 73 73 20 28 | win = (|access (|
|00004c30| 74 65 6d 70 2c 20 58 5f | 4f 4b 29 20 3d 3d 20 30 |temp, X_|OK) == 0|
|00004c40| 29 3b 0d 09 7d 0d 20 20 | 20 20 7d 0d 0d 20 20 69 |);..}. | }.. i|
|00004c50| 66 20 28 21 77 69 6e 20 | 26 26 20 65 6e 76 5f 65 |f (!win |&& env_e|
|00004c60| 78 65 63 5f 70 72 65 66 | 69 78 29 0d 20 20 20 20 |xec_pref|ix). |
|00004c70| 7b 0d 20 20 20 20 20 20 | 69 66 20 28 6d 61 63 68 |{. |if (mach|
|00004c80| 69 6e 65 5f 73 75 66 66 | 69 78 29 0d 09 7b 0d 09 |ine_suff|ix)..{..|
|00004c90| 20 20 73 74 72 63 70 79 | 20 28 74 65 6d 70 2c 20 | strcpy| (temp, |
|00004ca0| 65 6e 76 5f 65 78 65 63 | 5f 70 72 65 66 69 78 29 |env_exec|_prefix)|
|00004cb0| 3b 0d 09 20 20 73 74 72 | 63 61 74 20 28 74 65 6d |;.. str|cat (tem|
|00004cc0| 70 2c 20 6d 61 63 68 69 | 6e 65 5f 73 75 66 66 69 |p, machi|ne_suffi|
|00004cd0| 78 29 3b 0d 09 20 20 73 | 74 72 63 61 74 20 28 74 |x);.. s|trcat (t|
|00004ce0| 65 6d 70 2c 20 70 72 6f | 67 29 3b 0d 09 20 20 77 |emp, pro|g);.. w|
|00004cf0| 69 6e 20 3d 20 28 61 63 | 63 65 73 73 20 28 74 65 |in = (ac|cess (te|
|00004d00| 6d 70 2c 20 58 5f 4f 4b | 29 20 3d 3d 20 30 29 3b |mp, X_OK|) == 0);|
|00004d10| 0d 09 7d 0d 20 20 20 20 | 20 20 69 66 20 28 21 77 |..}. | if (!w|
|00004d20| 69 6e 29 0d 09 7b 0d 09 | 20 20 73 74 72 63 70 79 |in)..{..| strcpy|
|00004d30| 20 28 74 65 6d 70 2c 20 | 65 6e 76 5f 65 78 65 63 | (temp, |env_exec|
|00004d40| 5f 70 72 65 66 69 78 29 | 3b 0d 09 20 20 73 74 72 |_prefix)|;.. str|
|00004d50| 63 61 74 20 28 74 65 6d | 70 2c 20 70 72 6f 67 29 |cat (tem|p, prog)|
|00004d60| 3b 0d 09 20 20 77 69 6e | 20 3d 20 28 61 63 63 65 |;.. win| = (acce|
|00004d70| 73 73 20 28 74 65 6d 70 | 2c 20 58 5f 4f 4b 29 20 |ss (temp|, X_OK) |
|00004d80| 3d 3d 20 30 29 3b 0d 09 | 7d 0d 20 20 20 20 7d 0d |== 0);..|}. }.|
|00004d90| 0d 20 20 69 66 20 28 21 | 77 69 6e 29 0d 20 20 20 |. if (!|win). |
|00004da0| 20 7b 0d 20 20 20 20 20 | 20 69 66 20 28 6d 61 63 | {. | if (mac|
|00004db0| 68 69 6e 65 5f 73 75 66 | 66 69 78 29 0d 09 7b 0d |hine_suf|fix)..{.|
|00004dc0| 09 20 20 73 74 72 63 70 | 79 20 28 74 65 6d 70 2c |. strcp|y (temp,|
|00004dd0| 20 73 74 61 6e 64 61 72 | 64 5f 65 78 65 63 5f 70 | standar|d_exec_p|
|00004de0| 72 65 66 69 78 29 3b 0d | 09 20 20 73 74 72 63 61 |refix);.|. strca|
|00004df0| 74 20 28 74 65 6d 70 2c | 20 6d 61 63 68 69 6e 65 |t (temp,| machine|
|00004e00| 5f 73 75 66 66 69 78 29 | 3b 0d 09 20 20 73 74 72 |_suffix)|;.. str|
|00004e10| 63 61 74 20 28 74 65 6d | 70 2c 20 70 72 6f 67 29 |cat (tem|p, prog)|
|00004e20| 3b 0d 09 20 20 77 69 6e | 20 3d 20 28 61 63 63 65 |;.. win| = (acce|
|00004e30| 73 73 20 28 74 65 6d 70 | 2c 20 58 5f 4f 4b 29 20 |ss (temp|, X_OK) |
|00004e40| 3d 3d 20 30 29 3b 0d 09 | 7d 0d 20 20 20 20 20 20 |== 0);..|}. |
|00004e50| 69 66 20 28 21 77 69 6e | 29 0d 09 7b 0d 09 20 20 |if (!win|)..{.. |
|00004e60| 73 74 72 63 70 79 20 28 | 74 65 6d 70 2c 20 73 74 |strcpy (|temp, st|
|00004e70| 61 6e 64 61 72 64 5f 65 | 78 65 63 5f 70 72 65 66 |andard_e|xec_pref|
|00004e80| 69 78 29 3b 0d 09 20 20 | 73 74 72 63 61 74 20 28 |ix);.. |strcat (|
|00004e90| 74 65 6d 70 2c 20 70 72 | 6f 67 29 3b 0d 09 20 20 |temp, pr|og);.. |
|00004ea0| 77 69 6e 20 3d 20 28 61 | 63 63 65 73 73 20 28 74 |win = (a|ccess (t|
|00004eb0| 65 6d 70 2c 20 58 5f 4f | 4b 29 20 3d 3d 20 30 29 |emp, X_O|K) == 0)|
|00004ec0| 3b 0d 09 7d 0d 20 20 20 | 20 7d 0d 0d 20 20 69 66 |;..}. | }.. if|
|00004ed0| 20 28 21 77 69 6e 29 0d | 20 20 20 20 7b 0d 20 20 | (!win).| {. |
|00004ee0| 20 20 20 20 69 66 20 28 | 6d 61 63 68 69 6e 65 5f | if (|machine_|
|00004ef0| 73 75 66 66 69 78 29 0d | 09 7b 0d 09 20 20 73 74 |suffix).|.{.. st|
|00004f00| 72 63 70 79 20 28 74 65 | 6d 70 2c 20 73 74 61 6e |rcpy (te|mp, stan|
|00004f10| 64 61 72 64 5f 65 78 65 | 63 5f 70 72 65 66 69 78 |dard_exe|c_prefix|
|00004f20| 5f 31 29 3b 0d 09 20 20 | 73 74 72 63 61 74 20 28 |_1);.. |strcat (|
|00004f30| 74 65 6d 70 2c 20 6d 61 | 63 68 69 6e 65 5f 73 75 |temp, ma|chine_su|
|00004f40| 66 66 69 78 29 3b 0d 09 | 20 20 73 74 72 63 61 74 |ffix);..| strcat|
|00004f50| 20 28 74 65 6d 70 2c 20 | 70 72 6f 67 29 3b 0d 09 | (temp, |prog);..|
|00004f60| 20 20 77 69 6e 20 3d 20 | 28 61 63 63 65 73 73 20 | win = |(access |
|00004f70| 28 74 65 6d 70 2c 20 58 | 5f 4f 4b 29 20 3d 3d 20 |(temp, X|_OK) == |
|00004f80| 30 29 3b 0d 09 7d 0d 20 | 20 20 20 20 20 69 66 20 |0);..}. | if |
|00004f90| 28 21 77 69 6e 29 0d 09 | 7b 0d 09 20 20 73 74 72 |(!win)..|{.. str|
|00004fa0| 63 70 79 20 28 74 65 6d | 70 2c 20 73 74 61 6e 64 |cpy (tem|p, stand|
|00004fb0| 61 72 64 5f 65 78 65 63 | 5f 70 72 65 66 69 78 5f |ard_exec|_prefix_|
|00004fc0| 31 29 3b 0d 09 20 20 73 | 74 72 63 61 74 20 28 74 |1);.. s|trcat (t|
|00004fd0| 65 6d 70 2c 20 70 72 6f | 67 29 3b 0d 09 20 20 77 |emp, pro|g);.. w|
|00004fe0| 69 6e 20 3d 20 28 61 63 | 63 65 73 73 20 28 74 65 |in = (ac|cess (te|
|00004ff0| 6d 70 2c 20 58 5f 4f 4b | 29 20 3d 3d 20 30 29 3b |mp, X_OK|) == 0);|
|00005000| 0d 09 7d 0d 20 20 20 20 | 7d 0d 0d 20 20 69 66 20 |..}. |}.. if |
|00005010| 28 77 69 6e 29 0d 20 20 | 20 20 72 65 74 75 72 6e |(win). | return|
|00005020| 20 74 65 6d 70 3b 0d 20 | 20 65 6c 73 65 0d 20 20 | temp;. | else. |
|00005030| 20 20 72 65 74 75 72 6e | 20 30 3b 0d 7d 0d 0c 0d | return| 0;.}...|
|00005040| 2f 2a 20 73 74 64 69 6e | 20 66 69 6c 65 20 6e 75 |/* stdin| file nu|
|00005050| 6d 62 65 72 2e 20 20 2a | 2f 0d 23 64 65 66 69 6e |mber. *|/.#defin|
|00005060| 65 20 53 54 44 49 4e 5f | 46 49 4c 45 5f 4e 4f 20 |e STDIN_|FILE_NO |
|00005070| 30 0d 0d 2f 2a 20 73 74 | 64 6f 75 74 20 66 69 6c |0../* st|dout fil|
|00005080| 65 20 6e 75 6d 62 65 72 | 2e 20 20 2a 2f 0d 23 64 |e number|. */.#d|
|00005090| 65 66 69 6e 65 20 53 54 | 44 4f 55 54 5f 46 49 4c |efine ST|DOUT_FIL|
|000050a0| 45 5f 4e 4f 20 31 0d 0d | 2f 2a 20 76 61 6c 75 65 |E_NO 1..|/* value|
|000050b0| 20 6f 66 20 60 70 69 70 | 65 27 3a 20 70 6f 72 74 | of `pip|e': port|
|000050c0| 20 69 6e 64 65 78 20 66 | 6f 72 20 72 65 61 64 69 | index f|or readi|
|000050d0| 6e 67 2e 20 20 2a 2f 0d | 23 64 65 66 69 6e 65 20 |ng. */.|#define |
|000050e0| 52 45 41 44 5f 50 4f 52 | 54 20 30 0d 0d 2f 2a 20 |READ_POR|T 0../* |
|000050f0| 76 61 6c 75 65 20 6f 66 | 20 60 70 69 70 65 27 3a |value of| `pipe':|
|00005100| 20 70 6f 72 74 20 69 6e | 64 65 78 20 66 6f 72 20 | port in|dex for |
|00005110| 77 72 69 74 69 6e 67 2e | 20 20 2a 2f 0d 23 64 65 |writing.| */.#de|
|00005120| 66 69 6e 65 20 57 52 49 | 54 45 5f 50 4f 52 54 20 |fine WRI|TE_PORT |
|00005130| 31 0d 0d 2f 2a 20 50 69 | 70 65 20 77 61 69 74 69 |1../* Pi|pe waiti|
|00005140| 6e 67 20 66 72 6f 6d 20 | 6c 61 73 74 20 70 72 6f |ng from |last pro|
|00005150| 63 65 73 73 2c 20 74 6f | 20 62 65 20 75 73 65 64 |cess, to| be used|
|00005160| 20 61 73 20 69 6e 70 75 | 74 20 66 6f 72 20 74 68 | as inpu|t for th|
|00005170| 65 20 6e 65 78 74 20 6f | 6e 65 2e 0d 20 20 20 56 |e next o|ne.. V|
|00005180| 61 6c 75 65 20 69 73 20 | 53 54 44 49 4e 5f 46 49 |alue is |STDIN_FI|
|00005190| 4c 45 5f 4e 4f 20 69 66 | 20 6e 6f 20 70 69 70 65 |LE_NO if| no pipe|
|000051a0| 20 69 73 20 77 61 69 74 | 69 6e 67 0d 20 20 20 28 | is wait|ing. (|
|000051b0| 69 2e 65 2e 20 74 68 65 | 20 6e 65 78 74 20 63 6f |i.e. the| next co|
|000051c0| 6d 6d 61 6e 64 20 69 73 | 20 74 68 65 20 66 69 72 |mmand is| the fir|
|000051d0| 73 74 20 6f 66 20 61 20 | 67 72 6f 75 70 29 2e 20 |st of a |group). |
|000051e0| 20 2a 2f 0d 0d 69 6e 74 | 20 6c 61 73 74 5f 70 69 | */..int| last_pi|
|000051f0| 70 65 5f 69 6e 70 75 74 | 3b 0d 0d 2f 2a 20 46 6f |pe_input|;../* Fo|
|00005200| 72 6b 20 6f 6e 65 20 70 | 69 70 65 64 20 73 75 62 |rk one p|iped sub|
|00005210| 63 6f 6d 6d 61 6e 64 2e | 20 20 46 55 4e 43 20 69 |command.| FUNC i|
|00005220| 73 20 74 68 65 20 73 79 | 73 74 65 6d 20 63 61 6c |s the sy|stem cal|
|00005230| 6c 20 74 6f 20 75 73 65 | 0d 20 20 20 28 65 69 74 |l to use|. (eit|
|00005240| 68 65 72 20 65 78 65 63 | 76 20 6f 72 20 65 78 65 |her exec|v or exe|
|00005250| 63 76 70 29 2e 20 20 41 | 52 47 56 20 69 73 20 74 |cvp). A|RGV is t|
|00005260| 68 65 20 61 72 67 20 76 | 65 63 74 6f 72 20 74 6f |he arg v|ector to|
|00005270| 20 75 73 65 2e 0d 20 20 | 20 4e 4f 54 5f 4c 41 53 | use.. | NOT_LAS|
|00005280| 54 20 69 73 20 6e 6f 6e | 7a 65 72 6f 20 69 66 20 |T is non|zero if |
|00005290| 74 68 69 73 20 69 73 20 | 6e 6f 74 20 74 68 65 20 |this is |not the |
|000052a0| 6c 61 73 74 20 73 75 62 | 63 6f 6d 6d 61 6e 64 0d |last sub|command.|
|000052b0| 20 20 20 28 69 2e 65 2e | 20 69 74 73 20 6f 75 74 | (i.e.| its out|
|000052c0| 70 75 74 20 73 68 6f 75 | 6c 64 20 62 65 20 70 69 |put shou|ld be pi|
|000052d0| 70 65 64 20 74 6f 20 74 | 68 65 20 6e 65 78 74 20 |ped to t|he next |
|000052e0| 6f 6e 65 2e 29 20 20 2a | 2f 0d 0d 73 74 61 74 69 |one.) *|/..stati|
|000052f0| 63 20 69 6e 74 0d 70 65 | 78 65 63 75 74 65 20 28 |c int.pe|xecute (|
|00005300| 66 75 6e 63 2c 20 70 72 | 6f 67 72 61 6d 2c 20 61 |func, pr|ogram, a|
|00005310| 72 67 76 2c 20 6e 6f 74 | 5f 6c 61 73 74 29 0d 20 |rgv, not|_last). |
|00005320| 20 20 20 20 63 68 61 72 | 20 2a 70 72 6f 67 72 61 | char| *progra|
|00005330| 6d 3b 0d 20 20 20 20 20 | 69 6e 74 20 28 2a 66 75 |m;. |int (*fu|
|00005340| 6e 63 29 28 29 3b 0d 20 | 20 20 20 20 63 68 61 72 |nc)();. | char|
|00005350| 20 2a 61 72 67 76 5b 5d | 3b 0d 20 20 20 20 20 69 | *argv[]|;. i|
|00005360| 6e 74 20 6e 6f 74 5f 6c | 61 73 74 3b 0d 7b 0d 20 |nt not_l|ast;.{. |
|00005370| 20 69 6e 74 20 70 69 64 | 3b 0d 20 20 69 6e 74 20 | int pid|;. int |
|00005380| 70 64 65 73 5b 32 5d 3b | 0d 20 20 69 6e 74 20 69 |pdes[2];|. int i|
|00005390| 6e 70 75 74 5f 64 65 73 | 63 20 3d 20 6c 61 73 74 |nput_des|c = last|
|000053a0| 5f 70 69 70 65 5f 69 6e | 70 75 74 3b 0d 20 20 69 |_pipe_in|put;. i|
|000053b0| 6e 74 20 6f 75 74 70 75 | 74 5f 64 65 73 63 20 3d |nt outpu|t_desc =|
|000053c0| 20 53 54 44 4f 55 54 5f | 46 49 4c 45 5f 4e 4f 3b | STDOUT_|FILE_NO;|
|000053d0| 0d 0d 20 20 2f 2a 20 49 | 66 20 74 68 69 73 20 69 |.. /* I|f this i|
|000053e0| 73 6e 27 74 20 74 68 65 | 20 6c 61 73 74 20 70 72 |sn't the| last pr|
|000053f0| 6f 63 65 73 73 2c 20 6d | 61 6b 65 20 61 20 70 69 |ocess, m|ake a pi|
|00005400| 70 65 20 66 6f 72 20 69 | 74 73 20 6f 75 74 70 75 |pe for i|ts outpu|
|00005410| 74 2c 0d 20 20 20 20 20 | 61 6e 64 20 72 65 63 6f |t,. |and reco|
|00005420| 72 64 20 69 74 20 61 73 | 20 77 61 69 74 69 6e 67 |rd it as| waiting|
|00005430| 20 74 6f 20 62 65 20 74 | 68 65 20 69 6e 70 75 74 | to be t|he input|
|00005440| 20 74 6f 20 74 68 65 20 | 6e 65 78 74 20 70 72 6f | to the |next pro|
|00005450| 63 65 73 73 2e 20 20 2a | 2f 0d 0d 20 20 69 66 20 |cess. *|/.. if |
|00005460| 28 6e 6f 74 5f 6c 61 73 | 74 29 0d 20 20 20 20 7b |(not_las|t). {|
|00005470| 0d 20 20 20 20 20 20 69 | 66 20 28 70 69 70 65 20 |. i|f (pipe |
|00005480| 28 70 64 65 73 29 20 3c | 20 30 29 0d 09 70 66 61 |(pdes) <| 0)..pfa|
|00005490| 74 61 6c 5f 77 69 74 68 | 5f 6e 61 6d 65 20 28 22 |tal_with|_name ("|
|000054a0| 70 69 70 65 22 29 3b 0d | 20 20 20 20 20 20 6f 75 |pipe");.| ou|
|000054b0| 74 70 75 74 5f 64 65 73 | 63 20 3d 20 70 64 65 73 |tput_des|c = pdes|
|000054c0| 5b 57 52 49 54 45 5f 50 | 4f 52 54 5d 3b 0d 20 20 |[WRITE_P|ORT];. |
|000054d0| 20 20 20 20 6c 61 73 74 | 5f 70 69 70 65 5f 69 6e | last|_pipe_in|
|000054e0| 70 75 74 20 3d 20 70 64 | 65 73 5b 52 45 41 44 5f |put = pd|es[READ_|
|000054f0| 50 4f 52 54 5d 3b 0d 20 | 20 20 20 7d 0d 20 20 65 |PORT];. | }. e|
|00005500| 6c 73 65 0d 20 20 20 20 | 6c 61 73 74 5f 70 69 70 |lse. |last_pip|
|00005510| 65 5f 69 6e 70 75 74 20 | 3d 20 53 54 44 49 4e 5f |e_input |= STDIN_|
|00005520| 46 49 4c 45 5f 4e 4f 3b | 0d 0d 20 20 70 69 64 20 |FILE_NO;|.. pid |
|00005530| 3d 20 76 66 6f 72 6b 20 | 28 29 3b 0d 0d 20 20 73 |= vfork |();.. s|
|00005540| 77 69 74 63 68 20 28 70 | 69 64 29 0d 20 20 20 20 |witch (p|id). |
|00005550| 7b 0d 20 20 20 20 63 61 | 73 65 20 2d 31 3a 0d 20 |{. ca|se -1:. |
|00005560| 20 20 20 20 20 70 66 61 | 74 61 6c 5f 77 69 74 68 | pfa|tal_with|
|00005570| 5f 6e 61 6d 65 20 28 22 | 76 66 6f 72 6b 22 29 3b |_name ("|vfork");|
|00005580| 0d 20 20 20 20 20 20 62 | 72 65 61 6b 3b 0d 0d 20 |. b|reak;.. |
|00005590| 20 20 20 63 61 73 65 20 | 30 3a 20 2f 2a 20 63 68 | case |0: /* ch|
|000055a0| 69 6c 64 20 2a 2f 0d 20 | 20 20 20 20 20 2f 2a 20 |ild */. | /* |
|000055b0| 4d 6f 76 65 20 74 68 65 | 20 69 6e 70 75 74 20 61 |Move the| input a|
|000055c0| 6e 64 20 6f 75 74 70 75 | 74 20 70 69 70 65 73 20 |nd outpu|t pipes |
|000055d0| 69 6e 74 6f 20 70 6c 61 | 63 65 2c 20 69 66 20 6e |into pla|ce, if n|
|000055e0| 65 63 2e 20 20 2a 2f 0d | 20 20 20 20 20 20 69 66 |ec. */.| if|
|000055f0| 20 28 69 6e 70 75 74 5f | 64 65 73 63 20 21 3d 20 | (input_|desc != |
|00005600| 53 54 44 49 4e 5f 46 49 | 4c 45 5f 4e 4f 29 0d 09 |STDIN_FI|LE_NO)..|
|00005610| 7b 0d 09 20 20 63 6c 6f | 73 65 20 28 53 54 44 49 |{.. clo|se (STDI|
|00005620| 4e 5f 46 49 4c 45 5f 4e | 4f 29 3b 0d 09 20 20 64 |N_FILE_N|O);.. d|
|00005630| 75 70 20 28 69 6e 70 75 | 74 5f 64 65 73 63 29 3b |up (inpu|t_desc);|
|00005640| 0d 09 20 20 63 6c 6f 73 | 65 20 28 69 6e 70 75 74 |.. clos|e (input|
|00005650| 5f 64 65 73 63 29 3b 0d | 09 7d 0d 20 20 20 20 20 |_desc);.|.}. |
|00005660| 20 69 66 20 28 6f 75 74 | 70 75 74 5f 64 65 73 63 | if (out|put_desc|
|00005670| 20 21 3d 20 53 54 44 4f | 55 54 5f 46 49 4c 45 5f | != STDO|UT_FILE_|
|00005680| 4e 4f 29 0d 09 7b 0d 09 | 20 20 63 6c 6f 73 65 20 |NO)..{..| close |
|00005690| 28 53 54 44 4f 55 54 5f | 46 49 4c 45 5f 4e 4f 29 |(STDOUT_|FILE_NO)|
|000056a0| 3b 0d 09 20 20 64 75 70 | 20 28 6f 75 74 70 75 74 |;.. dup| (output|
|000056b0| 5f 64 65 73 63 29 3b 0d | 09 20 20 63 6c 6f 73 65 |_desc);.|. close|
|000056c0| 20 28 6f 75 74 70 75 74 | 5f 64 65 73 63 29 3b 0d | (output|_desc);.|
|000056d0| 09 7d 0d 0d 20 20 20 20 | 20 20 2f 2a 20 43 6c 6f |.}.. | /* Clo|
|000056e0| 73 65 20 74 68 65 20 70 | 61 72 65 6e 74 27 73 20 |se the p|arent's |
|000056f0| 64 65 73 63 73 20 74 68 | 61 74 20 61 72 65 6e 27 |descs th|at aren'|
|00005700| 74 20 77 61 6e 74 65 64 | 20 68 65 72 65 2e 20 20 |t wanted| here. |
|00005710| 2a 2f 0d 20 20 20 20 20 | 20 69 66 20 28 6c 61 73 |*/. | if (las|
|00005720| 74 5f 70 69 70 65 5f 69 | 6e 70 75 74 20 21 3d 20 |t_pipe_i|nput != |
|00005730| 53 54 44 49 4e 5f 46 49 | 4c 45 5f 4e 4f 29 0d 09 |STDIN_FI|LE_NO)..|
|00005740| 63 6c 6f 73 65 20 28 6c | 61 73 74 5f 70 69 70 65 |close (l|ast_pipe|
|00005750| 5f 69 6e 70 75 74 29 3b | 0d 0d 20 20 20 20 20 20 |_input);|.. |
|00005760| 2f 2a 20 45 78 65 63 20 | 74 68 65 20 70 72 6f 67 |/* Exec |the prog|
|00005770| 72 61 6d 2e 20 20 2a 2f | 0d 20 20 20 20 20 20 28 |ram. */|. (|
|00005780| 2a 66 75 6e 63 29 20 28 | 70 72 6f 67 72 61 6d 2c |*func) (|program,|
|00005790| 20 61 72 67 76 29 3b 0d | 20 20 20 20 20 20 70 65 | argv);.| pe|
|000057a0| 72 72 6f 72 5f 65 78 65 | 63 20 28 70 72 6f 67 72 |rror_exe|c (progr|
|000057b0| 61 6d 29 3b 0d 20 20 20 | 20 20 20 65 78 69 74 20 |am);. | exit |
|000057c0| 28 2d 31 29 3b 0d 20 20 | 20 20 20 20 2f 2a 20 4e |(-1);. | /* N|
|000057d0| 4f 54 52 45 41 43 48 45 | 44 20 2a 2f 0d 0d 20 20 |OTREACHE|D */.. |
|000057e0| 20 20 64 65 66 61 75 6c | 74 3a 0d 20 20 20 20 20 | defaul|t:. |
|000057f0| 20 2f 2a 20 49 6e 20 74 | 68 65 20 70 61 72 65 6e | /* In t|he paren|
|00005800| 74 2c 20 61 66 74 65 72 | 20 66 6f 72 6b 69 6e 67 |t, after| forking|
|00005810| 2e 0d 09 20 43 6c 6f 73 | 65 20 74 68 65 20 64 65 |... Clos|e the de|
|00005820| 73 63 72 69 70 74 6f 72 | 73 20 74 68 61 74 20 77 |scriptor|s that w|
|00005830| 65 20 6d 61 64 65 20 66 | 6f 72 20 74 68 69 73 20 |e made f|or this |
|00005840| 63 68 69 6c 64 2e 20 20 | 2a 2f 0d 20 20 20 20 20 |child. |*/. |
|00005850| 20 69 66 20 28 69 6e 70 | 75 74 5f 64 65 73 63 20 | if (inp|ut_desc |
|00005860| 21 3d 20 53 54 44 49 4e | 5f 46 49 4c 45 5f 4e 4f |!= STDIN|_FILE_NO|
|00005870| 29 0d 09 63 6c 6f 73 65 | 20 28 69 6e 70 75 74 5f |)..close| (input_|
|00005880| 64 65 73 63 29 3b 0d 20 | 20 20 20 20 20 69 66 20 |desc);. | if |
|00005890| 28 6f 75 74 70 75 74 5f | 64 65 73 63 20 21 3d 20 |(output_|desc != |
|000058a0| 53 54 44 4f 55 54 5f 46 | 49 4c 45 5f 4e 4f 29 0d |STDOUT_F|ILE_NO).|
|000058b0| 09 63 6c 6f 73 65 20 28 | 6f 75 74 70 75 74 5f 64 |.close (|output_d|
|000058c0| 65 73 63 29 3b 0d 0d 20 | 20 20 20 20 20 2f 2a 20 |esc);.. | /* |
|000058d0| 52 65 74 75 72 6e 20 63 | 68 69 6c 64 27 73 20 70 |Return c|hild's p|
|000058e0| 72 6f 63 65 73 73 20 6e | 75 6d 62 65 72 2e 20 20 |rocess n|umber. |
|000058f0| 2a 2f 0d 20 20 20 20 20 | 20 72 65 74 75 72 6e 20 |*/. | return |
|00005900| 70 69 64 3b 0d 20 20 20 | 20 7d 0d 7d 0d 0c 0d 2f |pid;. | }.}.../|
|00005910| 2a 20 45 78 65 63 75 74 | 65 20 74 68 65 20 63 6f |* Execut|e the co|
|00005920| 6d 6d 61 6e 64 20 73 70 | 65 63 69 66 69 65 64 20 |mmand sp|ecified |
|00005930| 62 79 20 74 68 65 20 61 | 72 67 75 6d 65 6e 74 73 |by the a|rguments|
|00005940| 20 6f 6e 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 | on the |current |
|00005950| 6c 69 6e 65 20 6f 66 20 | 73 70 65 63 2e 0d 20 20 |line of |spec.. |
|00005960| 20 57 68 65 6e 20 75 73 | 69 6e 67 20 70 69 70 65 | When us|ing pipe|
|00005970| 73 2c 20 74 68 69 73 20 | 69 6e 63 6c 75 64 65 73 |s, this |includes|
|00005980| 20 73 65 76 65 72 61 6c | 20 70 69 70 65 64 2d 74 | several| piped-t|
|00005990| 6f 67 65 74 68 65 72 20 | 63 6f 6d 6d 61 6e 64 73 |ogether |commands|
|000059a0| 0d 20 20 20 77 69 74 68 | 20 60 7c 27 20 62 65 74 |. with| `|' bet|
|000059b0| 77 65 65 6e 20 74 68 65 | 6d 2e 0d 0d 20 20 20 52 |ween the|m... R|
|000059c0| 65 74 75 72 6e 20 30 20 | 69 66 20 73 75 63 63 65 |eturn 0 |if succe|
|000059d0| 73 73 66 75 6c 2c 20 2d | 31 20 69 66 20 66 61 69 |ssful, -|1 if fai|
|000059e0| 6c 65 64 2e 20 20 2a 2f | 0d 0d 69 6e 74 0d 65 78 |led. */|..int.ex|
|000059f0| 65 63 75 74 65 20 28 29 | 0d 7b 0d 20 20 69 6e 74 |ecute ()|.{. int|
|00005a00| 20 69 2c 20 6a 3b 0d 20 | 20 69 6e 74 20 6e 5f 63 | i, j;. | int n_c|
|00005a10| 6f 6d 6d 61 6e 64 73 3b | 09 09 2f 2a 20 23 20 6f |ommands;|../* # o|
|00005a20| 66 20 63 6f 6d 6d 61 6e | 64 2e 20 20 2a 2f 0d 20 |f comman|d. */. |
|00005a30| 20 63 68 61 72 20 2a 73 | 74 72 69 6e 67 3b 0d 20 | char *s|tring;. |
|00005a40| 20 73 74 72 75 63 74 20 | 63 6f 6d 6d 61 6e 64 0d | struct |command.|
|00005a50| 20 20 20 20 7b 0d 20 20 | 20 20 20 20 63 68 61 72 | {. | char|
|00005a60| 20 2a 70 72 6f 67 3b 09 | 09 2f 2a 20 70 72 6f 67 | *prog;.|./* prog|
|00005a70| 72 61 6d 20 6e 61 6d 65 | 2e 20 20 2a 2f 0d 20 20 |ram name|. */. |
|00005a80| 20 20 20 20 63 68 61 72 | 20 2a 2a 61 72 67 76 3b | char| **argv;|
|00005a90| 09 09 2f 2a 20 76 65 63 | 74 6f 72 20 6f 66 20 61 |../* vec|tor of a|
|00005aa0| 72 67 73 2e 20 20 2a 2f | 0d 20 20 20 20 20 20 69 |rgs. */|. i|
|00005ab0| 6e 74 20 70 69 64 3b 09 | 09 09 2f 2a 20 70 69 64 |nt pid;.|../* pid|
|00005ac0| 20 6f 66 20 70 72 6f 63 | 65 73 73 20 66 6f 72 20 | of proc|ess for |
|00005ad0| 74 68 69 73 20 63 6f 6d | 6d 61 6e 64 2e 20 20 2a |this com|mand. *|
|00005ae0| 2f 0d 20 20 20 20 7d 3b | 0d 0d 20 20 73 74 72 75 |/. };|.. stru|
|00005af0| 63 74 20 63 6f 6d 6d 61 | 6e 64 20 2a 63 6f 6d 6d |ct comma|nd *comm|
|00005b00| 61 6e 64 73 3b 09 2f 2a | 20 65 61 63 68 20 63 6f |ands;./*| each co|
|00005b10| 6d 6d 61 6e 64 20 62 75 | 66 66 65 72 20 77 69 74 |mmand bu|ffer wit|
|00005b20| 68 20 61 62 6f 76 65 20 | 69 6e 66 6f 2e 20 20 2a |h above |info. *|
|00005b30| 2f 0d 0d 20 20 2f 2a 20 | 43 6f 75 6e 74 20 23 20 |/.. /* |Count # |
|00005b40| 6f 66 20 70 69 70 65 64 | 20 63 6f 6d 6d 61 6e 64 |of piped| command|
|00005b50| 73 2e 20 20 2a 2f 0d 20 | 20 66 6f 72 20 28 6e 5f |s. */. | for (n_|
|00005b60| 63 6f 6d 6d 61 6e 64 73 | 20 3d 20 31 2c 20 69 20 |commands| = 1, i |
|00005b70| 3d 20 30 3b 20 69 20 3c | 20 61 72 67 62 75 66 5f |= 0; i <| argbuf_|
|00005b80| 69 6e 64 65 78 3b 20 69 | 2b 2b 29 0d 20 20 20 20 |index; i|++). |
|00005b90| 69 66 20 28 73 74 72 63 | 6d 70 20 28 61 72 67 62 |if (strc|mp (argb|
|00005ba0| 75 66 5b 69 5d 2c 20 22 | 7c 22 29 20 3d 3d 20 30 |uf[i], "||") == 0|
|00005bb0| 29 0d 20 20 20 20 20 20 | 6e 5f 63 6f 6d 6d 61 6e |). |n_comman|
|00005bc0| 64 73 2b 2b 3b 0d 0d 20 | 20 2f 2a 20 47 65 74 20 |ds++;.. | /* Get |
|00005bd0| 73 74 6f 72 61 67 65 20 | 66 6f 72 20 65 61 63 68 |storage |for each|
|00005be0| 20 63 6f 6d 6d 61 6e 64 | 2e 20 20 2a 2f 0d 20 20 | command|. */. |
|00005bf0| 63 6f 6d 6d 61 6e 64 73 | 0d 20 20 20 20 3d 20 28 |commands|. = (|
|00005c00| 73 74 72 75 63 74 20 63 | 6f 6d 6d 61 6e 64 20 2a |struct c|ommand *|
|00005c10| 29 20 61 6c 6c 6f 63 61 | 20 28 6e 5f 63 6f 6d 6d |) alloca| (n_comm|
|00005c20| 61 6e 64 73 20 2a 20 73 | 69 7a 65 6f 66 20 28 73 |ands * s|izeof (s|
|00005c30| 74 72 75 63 74 20 63 6f | 6d 6d 61 6e 64 29 29 3b |truct co|mmand));|
|00005c40| 0d 0d 20 20 2f 2a 20 53 | 70 6c 69 74 20 61 72 67 |.. /* S|plit arg|
|00005c50| 62 75 66 20 69 6e 74 6f | 20 69 74 73 20 73 65 70 |buf into| its sep|
|00005c60| 61 72 61 74 65 20 70 69 | 70 65 64 20 70 72 6f 63 |arate pi|ped proc|
|00005c70| 65 73 73 65 73 2c 0d 20 | 20 20 20 20 61 6e 64 20 |esses,. | and |
|00005c80| 72 65 63 6f 72 64 20 69 | 6e 66 6f 20 61 62 6f 75 |record i|nfo abou|
|00005c90| 74 20 65 61 63 68 20 6f | 6e 65 2e 0d 20 20 20 20 |t each o|ne.. |
|00005ca0| 20 41 6c 73 6f 20 73 65 | 61 72 63 68 20 66 6f 72 | Also se|arch for|
|00005cb0| 20 74 68 65 20 70 72 6f | 67 72 61 6d 73 20 74 68 | the pro|grams th|
|00005cc0| 61 74 20 61 72 65 20 74 | 6f 20 62 65 20 72 75 6e |at are t|o be run|
|00005cd0| 2e 20 20 2a 2f 0d 0d 20 | 20 63 6f 6d 6d 61 6e 64 |. */.. | command|
|00005ce0| 73 5b 30 5d 2e 70 72 6f | 67 20 3d 20 61 72 67 62 |s[0].pro|g = argb|
|00005cf0| 75 66 5b 30 5d 3b 20 2f | 2a 20 66 69 72 73 74 20 |uf[0]; /|* first |
|00005d00| 63 6f 6d 6d 61 6e 64 2e | 20 20 2a 2f 0d 20 20 63 |command.| */. c|
|00005d10| 6f 6d 6d 61 6e 64 73 5b | 30 5d 2e 61 72 67 76 20 |ommands[|0].argv |
|00005d20| 3d 20 26 61 72 67 62 75 | 66 5b 30 5d 3b 0d 20 20 |= &argbu|f[0];. |
|00005d30| 73 74 72 69 6e 67 20 3d | 20 66 69 6e 64 5f 65 78 |string =| find_ex|
|00005d40| 65 63 5f 66 69 6c 65 20 | 28 63 6f 6d 6d 61 6e 64 |ec_file |(command|
|00005d50| 73 5b 30 5d 2e 70 72 6f | 67 29 3b 0d 20 20 69 66 |s[0].pro|g);. if|
|00005d60| 20 28 73 74 72 69 6e 67 | 29 0d 20 20 20 20 63 6f | (string|). co|
|00005d70| 6d 6d 61 6e 64 73 5b 30 | 5d 2e 61 72 67 76 5b 30 |mmands[0|].argv[0|
|00005d80| 5d 20 3d 20 73 74 72 69 | 6e 67 3b 0d 0d 20 20 66 |] = stri|ng;.. f|
|00005d90| 6f 72 20 28 6e 5f 63 6f | 6d 6d 61 6e 64 73 20 3d |or (n_co|mmands =|
|00005da0| 20 31 2c 20 69 20 3d 20 | 30 3b 20 69 20 3c 20 61 | 1, i = |0; i < a|
|00005db0| 72 67 62 75 66 5f 69 6e | 64 65 78 3b 20 69 2b 2b |rgbuf_in|dex; i++|
|00005dc0| 29 0d 20 20 20 20 69 66 | 20 28 73 74 72 63 6d 70 |). if| (strcmp|
|00005dd0| 20 28 61 72 67 62 75 66 | 5b 69 5d 2c 20 22 7c 22 | (argbuf|[i], "|"|
|00005de0| 29 20 3d 3d 20 30 29 0d | 20 20 20 20 20 20 7b 09 |) == 0).| {.|
|00005df0| 09 09 09 2f 2a 20 65 61 | 63 68 20 63 6f 6d 6d 61 |.../* ea|ch comma|
|00005e00| 6e 64 2e 20 20 2a 2f 0d | 09 61 72 67 62 75 66 5b |nd. */.|.argbuf[|
|00005e10| 69 5d 20 3d 20 30 3b 09 | 2f 2a 20 74 65 72 6d 69 |i] = 0;.|/* termi|
|00005e20| 6e 61 74 69 6f 6e 20 6f | 66 20 63 6f 6d 6d 61 6e |nation o|f comman|
|00005e30| 64 20 61 72 67 73 2e 20 | 20 2a 2f 0d 09 63 6f 6d |d args. | */..com|
|00005e40| 6d 61 6e 64 73 5b 6e 5f | 63 6f 6d 6d 61 6e 64 73 |mands[n_|commands|
|00005e50| 5d 2e 70 72 6f 67 20 3d | 20 61 72 67 62 75 66 5b |].prog =| argbuf[|
|00005e60| 69 20 2b 20 31 5d 3b 0d | 09 63 6f 6d 6d 61 6e 64 |i + 1];.|.command|
|00005e70| 73 5b 6e 5f 63 6f 6d 6d | 61 6e 64 73 5d 2e 61 72 |s[n_comm|ands].ar|
|00005e80| 67 76 20 3d 20 26 61 72 | 67 62 75 66 5b 69 20 2b |gv = &ar|gbuf[i +|
|00005e90| 20 31 5d 3b 0d 09 73 74 | 72 69 6e 67 20 3d 20 66 | 1];..st|ring = f|
|00005ea0| 69 6e 64 5f 65 78 65 63 | 5f 66 69 6c 65 20 28 63 |ind_exec|_file (c|
|00005eb0| 6f 6d 6d 61 6e 64 73 5b | 6e 5f 63 6f 6d 6d 61 6e |ommands[|n_comman|
|00005ec0| 64 73 5d 2e 70 72 6f 67 | 29 3b 0d 09 69 66 20 28 |ds].prog|);..if (|
|00005ed0| 73 74 72 69 6e 67 29 0d | 09 20 20 63 6f 6d 6d 61 |string).|. comma|
|00005ee0| 6e 64 73 5b 6e 5f 63 6f | 6d 6d 61 6e 64 73 5d 2e |nds[n_co|mmands].|
|00005ef0| 61 72 67 76 5b 30 5d 20 | 3d 20 73 74 72 69 6e 67 |argv[0] |= string|
|00005f00| 3b 0d 09 6e 5f 63 6f 6d | 6d 61 6e 64 73 2b 2b 3b |;..n_com|mands++;|
|00005f10| 0d 20 20 20 20 20 20 7d | 0d 0d 20 20 61 72 67 62 |. }|.. argb|
|00005f20| 75 66 5b 61 72 67 62 75 | 66 5f 69 6e 64 65 78 5d |uf[argbu|f_index]|
|00005f30| 20 3d 20 30 3b 0d 0d 20 | 20 2f 2a 20 49 66 20 2d | = 0;.. | /* If -|
|00005f40| 76 2c 20 70 72 69 6e 74 | 20 77 68 61 74 20 77 65 |v, print| what we|
|00005f50| 20 61 72 65 20 61 62 6f | 75 74 20 74 6f 20 64 6f | are abo|ut to do|
|00005f60| 2c 20 61 6e 64 20 6d 61 | 79 62 65 20 71 75 65 72 |, and ma|ybe quer|
|00005f70| 79 2e 20 20 2a 2f 0d 0d | 20 20 69 66 20 28 76 66 |y. */..| if (vf|
|00005f80| 6c 61 67 29 0d 20 20 20 | 20 7b 0d 20 20 20 20 20 |lag). | {. |
|00005f90| 20 2f 2a 20 50 72 69 6e | 74 20 65 61 63 68 20 70 | /* Prin|t each p|
|00005fa0| 69 70 65 64 20 63 6f 6d | 6d 61 6e 64 20 61 73 20 |iped com|mand as |
|00005fb0| 61 20 73 65 70 61 72 61 | 74 65 20 6c 69 6e 65 2e |a separa|te line.|
|00005fc0| 20 20 2a 2f 0d 20 20 20 | 20 20 20 66 6f 72 20 28 | */. | for (|
|00005fd0| 69 20 3d 20 30 3b 20 69 | 20 3c 20 6e 5f 63 6f 6d |i = 0; i| < n_com|
|00005fe0| 6d 61 6e 64 73 20 3b 20 | 69 2b 2b 29 0d 09 7b 0d |mands ; |i++)..{.|
|00005ff0| 09 20 20 63 68 61 72 20 | 2a 2a 6a 3b 0d 0d 09 20 |. char |**j;... |
|00006000| 20 66 6f 72 20 28 6a 20 | 3d 20 63 6f 6d 6d 61 6e | for (j |= comman|
|00006010| 64 73 5b 69 5d 2e 61 72 | 67 76 3b 20 2a 6a 3b 20 |ds[i].ar|gv; *j; |
|00006020| 6a 2b 2b 29 0d 09 20 20 | 20 20 66 70 72 69 6e 74 |j++).. | fprint|
|00006030| 66 20 28 73 74 64 65 72 | 72 2c 20 22 20 25 73 22 |f (stder|r, " %s"|
|00006040| 2c 20 2a 6a 29 3b 0d 0d | 09 20 20 2f 2a 20 50 72 |, *j);..|. /* Pr|
|00006050| 69 6e 74 20 61 20 70 69 | 70 65 20 73 79 6d 62 6f |int a pi|pe symbo|
|00006060| 6c 20 61 66 74 65 72 20 | 61 6c 6c 20 62 75 74 20 |l after |all but |
|00006070| 74 68 65 20 6c 61 73 74 | 20 63 6f 6d 6d 61 6e 64 |the last| command|
|00006080| 2e 20 20 2a 2f 0d 09 20 | 20 69 66 20 28 69 20 2b |. */.. | if (i +|
|00006090| 20 31 20 21 3d 20 6e 5f | 63 6f 6d 6d 61 6e 64 73 | 1 != n_|commands|
|000060a0| 29 0d 09 20 20 20 20 66 | 70 72 69 6e 74 66 20 28 |).. f|printf (|
|000060b0| 73 74 64 65 72 72 2c 20 | 22 20 7c 22 29 3b 0d 09 |stderr, |" |");..|
|000060c0| 20 20 66 70 72 69 6e 74 | 66 20 28 73 74 64 65 72 | fprint|f (stder|
|000060d0| 72 2c 20 22 5c 6e 22 29 | 3b 0d 09 7d 0d 20 20 20 |r, "\n")|;..}. |
|000060e0| 20 20 20 66 66 6c 75 73 | 68 20 28 73 74 64 65 72 | fflus|h (stder|
|000060f0| 72 29 3b 0d 23 69 66 64 | 65 66 20 44 45 42 55 47 |r);.#ifd|ef DEBUG|
|00006100| 0d 20 20 20 20 20 20 66 | 70 72 69 6e 74 66 20 28 |. f|printf (|
|00006110| 73 74 64 65 72 72 2c 20 | 22 5c 6e 47 6f 20 61 68 |stderr, |"\nGo ah|
|00006120| 65 61 64 3f 20 28 79 20 | 6f 72 20 6e 29 20 22 29 |ead? (y |or n) ")|
|00006130| 3b 0d 20 20 20 20 20 20 | 66 66 6c 75 73 68 20 28 |;. |fflush (|
|00006140| 73 74 64 65 72 72 29 3b | 0d 20 20 20 20 20 20 6a |stderr);|. j|
|00006150| 20 3d 20 67 65 74 63 68 | 61 72 20 28 29 3b 0d 20 | = getch|ar ();. |
|00006160| 20 20 20 20 20 69 66 20 | 28 6a 20 21 3d 20 27 5c | if |(j != '\|
|00006170| 6e 27 29 0d 09 77 68 69 | 6c 65 20 28 67 65 74 63 |n')..whi|le (getc|
|00006180| 68 61 72 20 28 29 20 21 | 3d 20 27 5c 6e 27 29 20 |har () !|= '\n') |
|00006190| 3b 0d 20 20 20 20 20 20 | 69 66 20 28 6a 20 21 3d |;. |if (j !=|
|000061a0| 20 27 79 27 20 26 26 20 | 6a 20 21 3d 20 27 59 27 | 'y' && |j != 'Y'|
|000061b0| 29 0d 09 72 65 74 75 72 | 6e 20 30 3b 0d 23 65 6e |)..retur|n 0;.#en|
|000061c0| 64 69 66 20 2f 2a 20 44 | 45 42 55 47 20 2a 2f 0d |dif /* D|EBUG */.|
|000061d0| 20 20 20 20 7d 0d 0d 20 | 20 2f 2a 20 52 75 6e 20 | }.. | /* Run |
|000061e0| 65 61 63 68 20 70 69 70 | 65 64 20 73 75 62 70 72 |each pip|ed subpr|
|000061f0| 6f 63 65 73 73 2e 20 20 | 2a 2f 0d 0d 20 20 6c 61 |ocess. |*/.. la|
|00006200| 73 74 5f 70 69 70 65 5f | 69 6e 70 75 74 20 3d 20 |st_pipe_|input = |
|00006210| 53 54 44 49 4e 5f 46 49 | 4c 45 5f 4e 4f 3b 0d 20 |STDIN_FI|LE_NO;. |
|00006220| 20 66 6f 72 20 28 69 20 | 3d 20 30 3b 20 69 20 3c | for (i |= 0; i <|
|00006230| 20 6e 5f 63 6f 6d 6d 61 | 6e 64 73 3b 20 69 2b 2b | n_comma|nds; i++|
|00006240| 29 0d 20 20 20 20 7b 0d | 20 20 20 20 20 20 65 78 |). {.| ex|
|00006250| 74 65 72 6e 20 69 6e 74 | 20 65 78 65 63 76 28 29 |tern int| execv()|
|00006260| 2c 20 65 78 65 63 76 70 | 28 29 3b 0d 20 20 20 20 |, execvp|();. |
|00006270| 20 20 63 68 61 72 20 2a | 73 74 72 69 6e 67 20 3d | char *|string =|
|00006280| 20 63 6f 6d 6d 61 6e 64 | 73 5b 69 5d 2e 61 72 67 | command|s[i].arg|
|00006290| 76 5b 30 5d 3b 0d 0d 20 | 20 20 20 20 20 63 6f 6d |v[0];.. | com|
|000062a0| 6d 61 6e 64 73 5b 69 5d | 2e 70 69 64 20 3d 20 70 |mands[i]|.pid = p|
|000062b0| 65 78 65 63 75 74 65 20 | 28 28 73 74 72 69 6e 67 |execute |((string|
|000062c0| 20 21 3d 20 63 6f 6d 6d | 61 6e 64 73 5b 69 5d 2e | != comm|ands[i].|
|000062d0| 70 72 6f 67 20 3f 20 65 | 78 65 63 76 20 3a 20 65 |prog ? e|xecv : e|
|000062e0| 78 65 63 76 70 29 2c 0d | 09 09 09 09 20 20 73 74 |xecvp),.|.... st|
|000062f0| 72 69 6e 67 2c 20 63 6f | 6d 6d 61 6e 64 73 5b 69 |ring, co|mmands[i|
|00006300| 5d 2e 61 72 67 76 2c 0d | 09 09 09 09 20 20 69 20 |].argv,.|.... i |
|00006310| 2b 20 31 20 3c 20 6e 5f | 63 6f 6d 6d 61 6e 64 73 |+ 1 < n_|commands|
|00006320| 29 3b 0d 0d 20 20 20 20 | 20 20 69 66 20 28 73 74 |);.. | if (st|
|00006330| 72 69 6e 67 20 21 3d 20 | 63 6f 6d 6d 61 6e 64 73 |ring != |commands|
|00006340| 5b 69 5d 2e 70 72 6f 67 | 29 0d 09 66 72 65 65 20 |[i].prog|)..free |
|00006350| 28 73 74 72 69 6e 67 29 | 3b 0d 20 20 20 20 7d 0d |(string)|;. }.|
|00006360| 0d 20 20 65 78 65 63 75 | 74 69 6f 6e 5f 63 6f 75 |. execu|tion_cou|
|00006370| 6e 74 2b 2b 3b 0d 0d 20 | 20 2f 2a 20 57 61 69 74 |nt++;.. | /* Wait|
|00006380| 20 66 6f 72 20 61 6c 6c | 20 74 68 65 20 73 75 62 | for all| the sub|
|00006390| 70 72 6f 63 65 73 73 65 | 73 20 74 6f 20 66 69 6e |processe|s to fin|
|000063a0| 69 73 68 2e 0d 20 20 20 | 20 20 57 65 20 64 6f 6e |ish.. | We don|
|000063b0| 27 74 20 63 61 72 65 20 | 77 68 61 74 20 6f 72 64 |'t care |what ord|
|000063c0| 65 72 20 74 68 65 79 20 | 66 69 6e 69 73 68 20 69 |er they |finish i|
|000063d0| 6e 3b 0d 20 20 20 20 20 | 77 65 20 6b 6e 6f 77 20 |n;. |we know |
|000063e0| 74 68 61 74 20 4e 5f 43 | 4f 4d 4d 41 4e 44 53 20 |that N_C|OMMANDS |
|000063f0| 77 61 69 74 73 20 77 69 | 6c 6c 20 67 65 74 20 74 |waits wi|ll get t|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.